Skip to content

Commit 2743caa

Browse files
flexartsDominic Winkler
authored andcommitted
Fix perl error "unescaped left brace in regex" for paranoid update hook
A literal "{" should now be escaped in a pattern starting from perl versions >= v5.26. In perl v5.22, using a literal { in a regular expression was deprecated, and will emit a warning if it isn't escaped: \{. In v5.26, this won't just warn, it'll cause a syntax error. (see https://metacpan.org/pod/release/RJBS/perl-5.22.0/pod/perldelta.pod) Signed-off-by: Dominic Winkler <[email protected]>
1 parent 5fa0f52 commit 2743caa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/hooks/update-paranoid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,13 @@ $op = 'U' if ($op eq 'R'
302302

303303
RULE:
304304
foreach (@$rules) {
305-
while (/\${user\.([a-z][a-zA-Z0-9]+)}/) {
305+
while (/\$\{user\.([a-z][a-zA-Z0-9]+)}/) {
306306
my $k = lc $1;
307307
my $v = $data{"user.$k"};
308308
next RULE unless defined $v;
309309
next RULE if @$v != 1;
310310
next RULE unless defined $v->[0];
311-
s/\${user\.$k}/$v->[0]/g;
311+
s/\$\{user\.$k}/$v->[0]/g;
312312
}
313313

314314
if (/^([AMD ]+)\s+of\s+([^\s]+)\s+for\s+([^\s]+)\s+diff\s+([^\s]+)$/) {

0 commit comments

Comments
 (0)