From: Vsevolod Stakhov Date: Thu, 4 Aug 2016 11:17:37 +0000 (+0100) Subject: [Feature] Allow all types of symbols to be added via __newindex method X-Git-Tag: 1.3.2~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b83ef94c28a590a4ce2d4d434d58d3b7902c9bae;p=rspamd.git [Feature] Allow all types of symbols to be added via __newindex method --- diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index ee6ab3ef7..ddd5d9146 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -1497,18 +1497,7 @@ lua_config_newindex (lua_State *L) if (lua_type (L, -1) == LUA_TSTRING) { type_str = lua_tostring (L, -1); - if (strcmp (type_str, "normal") == 0) { - type = SYMBOL_TYPE_NORMAL; - } - else if (strcmp (type_str, "virtual") == 0) { - type = SYMBOL_TYPE_VIRTUAL; - } - else if (strcmp (type_str, "callback") == 0) { - type = SYMBOL_TYPE_CALLBACK; - } - else { - msg_info_config ("unknown type: %s", type_str); - } + type = lua_parse_symbol_type (type_str); } lua_pop (L, 1);