about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-02 15:11:01 +0000
committerEric Wong <e@80x24.org>2022-10-02 15:12:53 +0000
commit1e7cc8849b56ec96a16fda97921e1612cedc01a3 (patch)
tree325d22bc2b687d189492627f7434cd43eb78a4a1
parentac22adc97342323e056bb36f9434458cc822e7d9 (diff)
downloadpublic-inbox-1e7cc8849b56ec96a16fda97921e1612cedc01a3.tar.gz
I'm not sure what kind of brain fart introduced this in
c1e7a048be9d32cd, but it happened :x.  We'll undef the $x
variable ASAP to save memory and make future errors like this
one more noticeable.

Fixes: c1e7a048be9d ("www: viewdiff: fix UTF-8 names inside mbox attachments")
-rw-r--r--lib/PublicInbox/ViewDiff.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm
index 95bbf2d2..124a723a 100644
--- a/lib/PublicInbox/ViewDiff.pm
+++ b/lib/PublicInbox/ViewDiff.pm
@@ -212,8 +212,9 @@ sub flush_diff ($$) {
                         for my $s (split(/((?:(?:^\+[^\n]*\n)+)|
                                         (?:(?:^-[^\n]*\n)+)|
                                         (?:^@@ [^\n]+\n))/xsm, $x)) {
+                                undef $x;
                                 if (!defined($dctx)) {
-                                        print $afh $x;
+                                        print $afh $s;
                                 } elsif ($s =~ s/\A@@ (\S+) (\S+) @@//) {
                                         print $zfh qq(<span\nclass="hunk">),
                                                 diff_hunk($dctx, $1, $2),