user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] viewdiff: fix parts of diff being appended after signature
@ 2022-10-02 15:11 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-10-02 15:11 UTC (permalink / raw)
  To: meta

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")
 lib/PublicInbox/ | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index 95bbf2d2..124a723a 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -212,8 +212,9 @@ sub flush_diff ($$) {
 			for my $s (split(/((?:(?:^\+[^\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),

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-02 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 15:11 [PATCH] viewdiff: fix parts of diff being appended after signature Eric Wong

Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).