diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-17 12:52:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-17 12:52:09 +0100 |
commit | b046b69e6c4c6821b04ede39a194422cbccf7924 (patch) | |
tree | 27f289bc1afcd2e022f37c667162b23f5d8a8697 /src | |
parent | d9a157872055ad382ee653fc864d85768fa989cc (diff) | |
download | rspamd-b046b69e6c4c6821b04ede39a194422cbccf7924.tar.gz rspamd-b046b69e6c4c6821b04ede39a194422cbccf7924.zip |
Revert "[Fix] Fix compatibility with old maps query logic"
This reverts commit d9a157872055ad382ee653fc864d85768fa989cc.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_map.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c index fe8c264d2..2d2a098d2 100644 --- a/src/lua/lua_map.c +++ b/src/lua/lua_map.c @@ -697,20 +697,6 @@ lua_map_process_string_key (lua_State *L, gint pos, gsize *len) return NULL; } -static inline void -lua_push_map_str_elt (lua_State *L, const gchar *value, gint len) -{ - if (len == 0 || value[0] == '\0') { - lua_pushstring (L, "1"); /* Compatibility */ - } - else if (len == -1) { - lua_pushstring (L, value); /* Zero terminated */ - } - else { - lua_pushlstring (L, value, len); - } -} - /* Radix and hash table functions */ static gint lua_map_get_key (lua_State * L) @@ -785,7 +771,7 @@ lua_map_get_key (lua_State * L) } if (ret) { - lua_push_map_str_elt (L, value, -1); + lua_pushstring (L, value); return 1; } } @@ -804,7 +790,7 @@ lua_map_get_key (lua_State * L) len); if (value) { - lua_push_map_str_elt (L, value, -1); + lua_pushstring (L, value); return 1; } } @@ -824,7 +810,7 @@ lua_map_get_key (lua_State * L) lua_createtable (L, ar->len, 0); PTR_ARRAY_FOREACH (ar, i, val) { - lua_push_map_str_elt (L, val, -1); + lua_pushstring (L, val); lua_rawseti (L, -2, i + 1); } @@ -843,7 +829,7 @@ lua_map_get_key (lua_State * L) } if (value) { - lua_push_map_str_elt (L, value, -1); + lua_pushstring (L, value); return 1; } } |