quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] test: Escape curly braces in regex


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] test: Escape curly braces in regex
Date: Tue, 18 Apr 2017 09:42:35 +0200

Curly braces in perl regex are supposed to be escaped, recent
versions of perl complain when they aren't:

Unescaped left brace in regex is deprecated, passed through in regex; marked by 
<-- HERE in m/%{ <-- HERE (\w+)}/ at ./run line 114.
Unescaped left brace in regex is deprecated, passed through in regex; marked by 
<-- HERE in m/%{ <-- HERE \?}/ at ./run line 290.

Signed-off-by: Jean Delvare <address@hidden>
---
 test/run |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/test/run
+++ b/test/run
@@ -112,7 +112,7 @@ sub flush_output()
 sub substitute_vars($)
 {
        my ($line) = @_;
-       $line =~ s[%{(\w+)}][defined $ENV{$1} ? $ENV{$1} : ""]eg;
+       $line =~ s[%\{(\w+)\}][defined $ENV{$1} ? $ENV{$1} : ""]eg;
        return $line;
 }
 
@@ -288,7 +288,7 @@ while (defined(my $line = <SOURCE>)) {
        # Parse the next command
        if ($line =~ s/^\s*\$ ?//) {
                # Substitute %{?} with the last command's status
-               $line =~ s[%{\?}][$last_status]eg;
+               $line =~ s[%\{\?\}][$last_status]eg;
 
                chomp($prog = substitute_vars($line));
                $prog_line = $lineno;
-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]