diff options
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r-- | src/lua/lua_common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 209e68fb1..bea2f0a58 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -629,10 +629,10 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos, state = read_arg; keylen = p - key; } - else if (*p == '*') { + else if (*p == '*' && key == NULL) { required = TRUE; } - else { + else if (key == NULL) { key = p; } p ++; @@ -787,15 +787,16 @@ rspamd_lua_parse_table_arguments (lua_State *L, gint pos, break; case read_semicolon: - if (*p == ':') { + if (*p == ';' || p == end) { state = read_key; key = NULL; keylen = 0; failed = FALSE; } else { - g_set_error (err, lua_error_quark (), 2, "bad format string: %s", - extraction_pattern); + g_set_error (err, lua_error_quark (), 2, "bad format string: %s," + " at char %c, position %d", + extraction_pattern, *p, (int)(p - extraction_pattern)); va_end (ap); return FALSE; |