aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-16 17:51:12 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-16 17:51:12 +0000
commit776f8b34704c2caa35d09ae6b9a58249cd8fe463 (patch)
tree7bc06742c75d1eb3622ded98ad9c4533e6770888
parent2058ed81f484b3dfc3a1495cdba84f6f2114abb1 (diff)
downloadrspamd-776f8b34704c2caa35d09ae6b9a58249cd8fe463.tar.gz
rspamd-776f8b34704c2caa35d09ae6b9a58249cd8fe463.zip
Skip unnecessary stuff in lua preprocessing
-rw-r--r--src/rspamadm/lua_preprocess.pl3
1 files changed, 3 insertions, 0 deletions
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