From 3a2f21e2cb2e054be70505fae522a71627391610 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Feb 2019 11:40:13 +0000 Subject: viewdiff: group path match to not be confused by "/dev/null" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leaving out parentheses caused transitions to state="del" or state="add" to be misidentified. cf. https://public-inbox.org/meta/20190204105454.GG10587@szeder.dev/ Reported-by: SZEDER Gábor --- lib/PublicInbox/ViewDiff.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index c818203b..a773e385 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -190,8 +190,8 @@ sub flush_diff ($$$) { $$dst .= ''; $state = DSTATE_CTX; $$dst .= to_html($linkify, $s); - } elsif ($s =~ m!^--- $PATH_A! || - $s =~ m!^\+{3} $PATH_B!) { + } elsif ($s =~ m!^--- (?:$PATH_A)! || + $s =~ m!^\+{3} (?:$PATH_B)!) { # color only (no oid link) if missing dctx->{oid_*} $state <= DSTATE_STAT and to_state($dst, $state, DSTATE_HEAD); -- cgit v1.2.3-24-ge0c7