From 31a6ff1221fe70f309ac2476024ebb7953a4e477 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Jun 2016 23:36:36 +0000 Subject: inbox: ensure we do not show leading "From " lines Some messages will be misimported due to an old bug, clean them up and ensure we do not propagate the mistake. Followup-to: a0c07cba0e5d ("mda: drop leading "From " lines again") --- lib/PublicInbox/Inbox.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 34191fc7..87c2c9fc 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -99,7 +99,9 @@ sub nntp_usable { sub msg_by_path ($$;$) { my ($self, $path, $ref) = @_; # TODO: allow other refs: - git($self)->cat_file('HEAD:'.$path, $ref); + my $str = git($self)->cat_file('HEAD:'.$path, $ref); + $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; + $str; } sub msg_by_mid ($$;$) { -- cgit v1.2.3-24-ge0c7