]> source.dussan.org Git - rspamd.git/commitdiff
Skip unnecessary stuff in lua preprocessing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Dec 2015 17:51:12 +0000 (17:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Dec 2015 17:51:12 +0000 (17:51 +0000)
src/rspamadm/lua_preprocess.pl

index 4a84689a4bda13eddf01a42ad1d4bf6d7b6dcd90..b1799468419291126cce462e1d8d4fdd7c09ec13 100644 (file)
@@ -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