unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] view: avoid extraneous space for subject-only messages
@ 2014-09-07  7:55 Eric Wong
  2014-09-07  7:57 ` [PATCH] view: fixup dropped newline in the last commit Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2014-09-07  7:55 UTC (permalink / raw)
  To: meta

Sometimes, the subject says it all.
---
 lib/PublicInbox/View.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 2e7c874..5076cf9 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;
 	});
 
-- 
EW

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] view: fixup dropped newline in the last commit
  2014-09-07  7:55 [PATCH] view: avoid extraneous space for subject-only messages Eric Wong
@ 2014-09-07  7:57 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2014-09-07  7:57 UTC (permalink / raw)
  To: meta

Oops!
---
 lib/PublicInbox/View.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 5076cf9..262e72e 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -115,7 +115,7 @@ sub index_entry {
 			# add prefix:
 			$s =~ s/^/$pfx/sgm;
 
-			$rv .= $s;
+			$rv .= $s . "\n";
 		}
 		++$part_nr;
 	});
-- 
EW

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-07  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-07  7:55 [PATCH] view: avoid extraneous space for subject-only messages Eric Wong
2014-09-07  7:57 ` [PATCH] view: fixup dropped newline in the last commit Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).