aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-10 18:54:26 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-10 18:54:26 +0400
commitcef2f44866f6311411929c09c95f3af906ba5bc3 (patch)
tree96f0d1a698713996bc4941ca0790f026aeed1343 /src/lua/lua_config.c
parent57c077a06e7d04d5d053a4f3565319dd9e41f442 (diff)
downloadrspamd-cef2f44866f6311411929c09c95f3af906ba5bc3.tar.gz
rspamd-cef2f44866f6311411929c09c95f3af906ba5bc3.zip
Fix trie text search.
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 4ca3b7e45..b4db951ff 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -721,6 +721,7 @@ lua_trie_search_text (lua_State *L)
const gchar *text, *pos;
gint id, i = 1;
gsize len;
+ gboolean found = FALSE;
if (trie) {
text = luaL_checkstring (L, 2);
@@ -733,6 +734,12 @@ lua_trie_search_text (lua_State *L)
lua_pushinteger (L, id);
lua_settable (L, -3);
i ++;
+ found = TRUE;
+ break;
+ }
+
+ if (!found) {
+ lua_pushnil (L);
}
return 1;
}