From f4af1462c2e52a5f4ed8b7de855868b8d457627e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Mar 2016 06:51:22 +0000 Subject: searchmsg: preserve hard tabs, but drop CR (\r) Hard tabs *may* be searchable, so preserve them since they do not take up any more space than a normal space. However, CR (carriage return) is worthless and likely a sign of a buggy mail (or spam) client anyways. --- lib/PublicInbox/SearchMsg.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index 477ffff7..a0899159 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -65,7 +65,8 @@ sub __hdr ($$) { my $mime = $self->{mime} or return; $val = $mime->header($field); $val = '' unless defined $val; - $val =~ tr/\t\r\n/ /; + $val =~ tr/\n/ /; + $val =~ tr/\r//d; $self->{$field} = $val; } -- cgit v1.2.3-24-ge0c7