Skip to content

Commit

Permalink
A line is a section only if it ends with { https://www.virtualmin.com…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Aug 31, 2018
1 parent 48836dd commit bc93695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virtualmin-nginx-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub read_config_file
$lnum++;
}

if ($l =~ /^\s*if\s*\((.*)\)\s*\{/) {
if ($l =~ /^\s*if\s*\((.*)\)\s*\{\s*$/) {
# Start of an if statement
my $ns = { 'name' => 'if',
'type' => 2,
Expand All @@ -100,7 +100,7 @@ sub read_config_file
push(@$addto, $ns);
$addto = $ns->{'members'};
}
elsif ($l =~ /^\s*(\S+)(\s*.*)\{/) {
elsif ($l =~ /^\s*(\S+)(\s*.*)\{\s*$/) {
# Start of a section
my $ns = { 'name' => $1,
'type' => 1,
Expand Down

0 comments on commit bc93695

Please sign in to comment.