From 3e9e1b30f3d25adf7e1ffee1047efb01870378c9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Sep 2014 07:53:47 +0000 Subject: view: avoid extraneous space for subject-only messages Sometimes, the subject says it all. --- lib/PublicInbox/View.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2e7c8747..5076cf92 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -111,10 +111,12 @@ sub index_entry { $s =~ s/\A\s+//s; $s =~ s/\s+\z//s; - # add prefix: - $s =~ s/^/$pfx/sgm; + if (length $s) { + # add prefix: + $s =~ s/^/$pfx/sgm; - $rv .= $s . "\n"; + $rv .= $s; + } ++$part_nr; }); -- cgit v1.2.3-24-ge0c7