Handle comments using --comment with spaces and - in them

This commit is contained in:
Jamie Cameron
2008-11-05 21:06:12 +00:00
parent 6df0521b19
commit e557ad44a2
2 changed files with 7 additions and 1 deletions

View File

@@ -21,3 +21,4 @@ Added a setup option to configure a firewall for a typical hosting server.
Show SNAT and masquerade inputs in custom NAT chains.
---- Changes since 1.440 ----
DNS queries are now allowed when the firewall is setup for web hosting.
Rule coments using --comment containing spaces or - are now properly parsed.

View File

@@ -86,7 +86,12 @@ while(<FILE>) {
# Parse arguments
foreach $a (@known_args) {
local @vl;
while($rule->{'args'} =~ s/\s+(!?)\s*($a)\s+(!?)\s*(([^ \-!]\S*(\s+|$))+)/ / || $rule->{'args'} =~ s/\s+(!?)\s*($a)()(\s+|$)/ /) {
while($rule->{'args'} =~
s/\s+(!?)\s*($a)\s+(!?)\s*("[^"]*")(\s+|$)/ / ||
$rule->{'args'} =~
s/\s+(!?)\s*($a)\s+(!?)\s*(([^ \-!]\S*(\s+|$))+)/ / ||
$rule->{'args'} =~
s/\s+(!?)\s*($a)()(\s+|$)/ /) {
push(@vl, [ $1 || $3, &split_quoted_string($4) ]);
}
local ($aa = $a); $aa =~ s/^-+//;