From: Martin Quinson Date: Sat, 7 Nov 2015 20:57:12 +0000 (+0100) Subject: [tesh] try to properly quote the regexps for Perl 5.22 X-Git-Tag: v3_13~1591 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1664069f43acb3abdb6dbcd02d024cbac957e0e6?hp=b85de8f1e83118f564f9ee5af0c4d90049147739 [tesh] try to properly quote the regexps for Perl 5.22 --- diff --git a/tools/tesh/tesh.pl b/tools/tesh/tesh.pl index 54f053a753..2e0ec34fd6 100755 --- a/tools/tesh/tesh.pl +++ b/tools/tesh/tesh.pl @@ -342,7 +342,7 @@ sub exec_cmd { } # substitute remaining variables, if any - while ( $cmd{'cmd'} =~ /\${(\w+)(?::[=-][^}]*)?}/ ) { + while ( $cmd{'cmd'} =~ /\$\{(\w+)(?::[=-][^}]*)?\}/ ) { $cmd{'cmd'} = var_subst( $cmd{'cmd'}, $1, "" ); } while ( $cmd{'cmd'} =~ /\$(\w+)/ ) { @@ -730,11 +730,11 @@ sub build_diff { sub var_subst { my ( $text, $name, $value ) = @_; if ($value) { - $text =~ s/\${$name(?::[=-][^}]*)?}/$value/g; + $text =~ s/\$\{$name(?::[=-][^}]*)?\}/$value/g; $text =~ s/\$$name(\W|$)/$value$1/g; } else { - $text =~ s/\${$name:=([^}]*)}/$1/g; - $text =~ s/\${$name}//g; + $text =~ s/\$\{$name:=([^}]*)\}/$1/g; + $text =~ s/\$\{$name\}//g; $text =~ s/\$$name(\W|$)/$1/g; } return $text;