]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: kill leading whitespace in index
authorEric Wong <e@80x24.org>
Sun, 31 Aug 2014 02:58:07 +0000 (02:58 +0000)
committerEric Wong <e@80x24.org>
Sun, 31 Aug 2014 02:58:07 +0000 (02:58 +0000)
Leading whitespace is pointless, but some folks end up adding
it for some reason.

lib/PublicInbox/View.pm

index c1a5fbb17e0af4a703b89aa3031ad0b85f477135..1fb40068a613119b086a63ebb96ac37371bb50a8 100644 (file)
@@ -113,7 +113,8 @@ sub index_entry {
                        $more = "$pfx...\n";
                }
 
-               # kill any trailing whitespace
+               # kill any leading or trailing whitespace
+               $s =~ s/\A\s+//s;
                $s =~ s/\s+\z//s;
 
                # add prefix: