From: Vsevolod Stakhov Date: Wed, 16 Dec 2015 17:51:12 +0000 (+0000) Subject: Skip unnecessary stuff in lua preprocessing X-Git-Tag: 1.1.0~270 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=776f8b34704c2caa35d09ae6b9a58249cd8fe463;p=rspamd.git Skip unnecessary stuff in lua preprocessing --- diff --git a/src/rspamadm/lua_preprocess.pl b/src/rspamadm/lua_preprocess.pl index 4a84689a4..b17994684 100644 --- a/src/rspamadm/lua_preprocess.pl +++ b/src/rspamadm/lua_preprocess.pl @@ -15,6 +15,9 @@ sub quote_file { quote_file($inc, $out); } else { + s/^\s*//; # remove unnecessary spaces at the beginning + next if /^--/; # skip comments + next if /^\s*$/; # skip empty lines s/(.)/'$1',/g; # split as 'c', s/\'\\\'/\'\\\\'/g; # escape backslashes s/\'\'\'/\'\\\'\'/g; # escape single quotes