From 776f8b34704c2caa35d09ae6b9a58249cd8fe463 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 16 Dec 2015 17:51:12 +0000 Subject: [PATCH] Skip unnecessary stuff in lua preprocessing --- src/rspamadm/lua_preprocess.pl | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5