From 01a7a480e1856ee7efeb939ca79ecf27f1240116 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 21 Jul 2007 19:24:43 +0000 Subject: [PATCH] Combine two pattern matches git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6927 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Config.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 5368cbbd7..874c67aa2 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -875,10 +875,10 @@ sub read_a_line() { # # Expand Shell Variables using %ENV # - while ( $currentline =~ /^(.*?)\$([a-zA-Z]\w*)(.*)$/ || $currentline =~ /^(.*?)\${([a-zA-Z]\w*)}(.*)$/ ) { - my $val = $ENV{$2}; + while ( $currentline =~ /^(.*?)\$({)?([a-zA-Z]\w*)(?(2)}|)(.*)$/ ) { + my $val = $ENV{$3}; $val = '' unless defined $val; - $currentline = join( '', $1 , $val , $3 ); + $currentline = join( '', $1 , $val , $4 ); } if ( $currentline =~ /^\s*INCLUDE\s/ ) {