1 From 5193b137b5a9034ce79946edd40760df2f63a82a Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <jdelvare@suse.de>
3 Date: Tue, 25 Apr 2017 15:17:53 +0200
4 Subject: test: Escape curly braces in regex
6 Curly braces in perl regex are supposed to be escaped, recent
7 versions of perl complain when they aren't:
9 Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (\w+)}/ at ./run line 114.
10 Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE \?}/ at ./run line 290.
12 Signed-off-by: Jean Delvare <jdelvare@suse.de>
15 1 file changed, 2 insertions(+), 2 deletions(-)
17 diff --git a/test/run b/test/run
18 index 942014e..03afc7a 100755
21 @@ -112,7 +112,7 @@ sub flush_output()
22 sub substitute_vars($)
25 - $line =~ s[%{(\w+)}][defined $ENV{$1} ? $ENV{$1} : ""]eg;
26 + $line =~ s[%\{(\w+)\}][defined $ENV{$1} ? $ENV{$1} : ""]eg;
30 @@ -288,7 +288,7 @@ while (defined(my $line = <SOURCE>)) {
31 # Parse the next command
32 if ($line =~ s/^\s*\$ ?//) {
33 # Substitute %{?} with the last command's status
34 - $line =~ s[%{\?}][$last_status]eg;
35 + $line =~ s[%\{\?\}][$last_status]eg;
37 chomp($prog = substitute_vars($line));