From: Vsevolod Stakhov Date: Fri, 22 Apr 2022 20:47:19 +0000 (+0100) Subject: [Minor] Try to fix another stupid cases of dot commands X-Git-Tag: 3.3~300 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57e26bc8223b594286d8d2a764b00e2e63448bb4;p=thirdparty%2Frspamd.git [Minor] Try to fix another stupid cases of dot commands Have anybody used them ever? --- diff --git a/src/rspamadm/lua_repl.c b/src/rspamadm/lua_repl.c index f81cf4ad34..de0f7a0abd 100644 --- a/src/rspamadm/lua_repl.c +++ b/src/rspamadm/lua_repl.c @@ -630,10 +630,19 @@ rspamadm_lua_run_repl (lua_State *L, bool is_batch) if (linelen > 0) { if (input[linelen - 1] == '\n') { - linelen--; + input[linelen - 1] = '\0'; + linelen --; } - rspamadm_exec_input(L, input); + if (linelen > 0) { + if (input[0] == '.') { + if (rspamadm_lua_try_dot_command(L, input)) { + continue; + } + } + + rspamadm_exec_input(L, input); + } } else { break;