]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: avoid extraneous space for subject-only messages
authorEric Wong <e@80x24.org>
Sun, 7 Sep 2014 07:53:47 +0000 (07:53 +0000)
committerEric Wong <e@80x24.org>
Sun, 7 Sep 2014 07:53:47 +0000 (07:53 +0000)
Sometimes, the subject says it all.

lib/PublicInbox/View.pm

index 2e7c874779edc5d000a09f6e8d5f03e8c28fea53..5076cf923baa671f6a6e1b8375f6e6ca395e6e6c 100644 (file)
@@ -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;
        });