From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6C02E205CC for ; Mon, 11 Apr 2016 05:07:13 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] mbox: unconditionally add trailing newline Date: Mon, 11 Apr 2016 05:07:13 +0000 Message-Id: <20160411050713.18395-1-e@80x24.org> List-Id: This may be necessary for compatibility with non-mboxrd aware parsers which expect "\nFrom " for everything but the first record. --- lib/PublicInbox/Mbox.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 0d67981..9f20580 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -67,9 +67,7 @@ sub emit_msg { # ref: http://www.qmail.org/man/man5/mbox.html $buf =~ s/^(>*From )/>$1/gm; - $buf .= "\n" unless $buf =~ /\n\z/s; - - $fh->write($buf); + $fh->write($buf .= "\n"); } sub emit_mbox { -- EW