]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewdiff: group path match to not be confused by "/dev/null"
authorEric Wong <e@80x24.org>
Mon, 4 Feb 2019 11:40:13 +0000 (11:40 +0000)
committerEric Wong <e@80x24.org>
Mon, 4 Feb 2019 11:42:47 +0000 (11:42 +0000)
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 <szeder.dev@gmail.com>
lib/PublicInbox/ViewDiff.pm

index c818203ba1f8340c8a1e3fc30fd0d244c84bd9a9..a773e385a33b8e9fcdc351e1a10cb460026e95de 100644 (file)
@@ -190,8 +190,8 @@ sub flush_diff ($$$) {
                        $$dst .= '</span>';
                        $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);