From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 595271F51E for ; Sun, 2 Oct 2022 15:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1664723461; bh=wuDEUWKZUsKeScgt+5FopHuf0v7cEYMHeC33t7hcubI=; h=From:To:Subject:Date:From; b=c6YdiRu4wGwHo9lm88Lw6eYe8WosY9gYeg7Xy2EcBKv33b2/SiYEnr7bQ8MC98oBZ Ntle/Yeu8cLAKSGB7OOcXeWyCA9OVnAZqTetzjOkA+lqOxOaXAW8YZjH4qHuYvZl+O A5HQFYAKxkD2E3WO1xlKkHZEjOKH3/8nN8G7uprg= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] viewdiff: fix parts of diff being appended after signature Date: Sun, 2 Oct 2022 15:11:01 +0000 Message-Id: <20221002151101.6681-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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/ViewDiff.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(), diff_hunk($dctx, $1, $2),