diff options
author | Eric Wong <e@80x24.org> | 2019-04-26 07:42:24 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-04-26 07:42:24 +0000 |
commit | 0195eb10a0cb74ebe098b4596e8e78d0544df6fb (patch) | |
tree | d9a349e6c524851a24d4607db06b6d482af44301 /lib/PublicInbox/ViewDiff.pm | |
parent | 31f2f298fe245d5762101bc229416b26c4e85679 (diff) | |
download | public-inbox-0195eb10a0cb74ebe098b4596e8e78d0544df6fb.tar.gz |
It seems a common case for mangled patches is editors or MUAs dropping trailing whitespace, and lines matching /^ $/ gets the space dropped to only match /^$/.
Diffstat (limited to 'lib/PublicInbox/ViewDiff.pm')
-rw-r--r-- | lib/PublicInbox/ViewDiff.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index 0cce952d..6b8d9437 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -146,7 +146,7 @@ sub flush_diff ($$$) { if ($s =~ /^---$/) { to_state($dst, $state, DSTATE_STAT); $$dst .= $s; - } elsif ($s =~ /^ /) { + } elsif ($s =~ /^ / || ($s =~ /^$/ && $state >= DSTATE_CTX)) { # works for common cases, but not weird/long filenames if ($state == DSTATE_STAT && $s =~ /^ (.+)( +\| .*\z)/s) { |