From 7957be919f9fcf2c1dd9a2c0c1cc1e775de1ff52 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 28 May 2021 00:07:53 +0000 Subject: viewdiff: escape '{' and '}' for regexp Perl 5 doesn't warn on this, yet, but it warns on unescaped '(' and ')' nowadays, so it's conceivable Perl could start warning on this in the future. So future-proof our code and reduce reader confusion. --- lib/PublicInbox/ViewDiff.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/ViewDiff.pm') diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index 05acc242..f492b697 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -77,7 +77,7 @@ sub anchor0 ($$$$) { # which works well in practice. If projects put "=>", or trailing # spaces in filenames, oh well :P $fn =~ s/$DIFFSTAT_COMMENT//; - $fn =~ s/{(?:.+) => (.+)}/$1/ or $fn =~ s/.* => (.+)/$1/; + $fn =~ s/\{(?:.+) => (.+)\}/$1/ or $fn =~ s/.* => (.+)/$1/; $fn = git_unquote($fn); # long filenames will require us to check in anchor1() -- cgit v1.2.3-24-ge0c7