From bc936953022e3aba65297aad51edc0044b02ff14 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 31 Aug 2018 16:10:24 -0700 Subject: [PATCH] A line is a section only if it ends with { https://www.virtualmin.com/node/58585 --- virtualmin-nginx-lib.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtualmin-nginx-lib.pl b/virtualmin-nginx-lib.pl index dded256..e8a23bd 100644 --- a/virtualmin-nginx-lib.pl +++ b/virtualmin-nginx-lib.pl @@ -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, @@ -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,