From 1664069f43acb3abdb6dbcd02d024cbac957e0e6 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 7 Nov 2015 21:57:12 +0100 Subject: [PATCH] [tesh] try to properly quote the regexps for Perl 5.22 --- tools/tesh/tesh.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.20.1