]> code.delx.au - gnu-emacs/blobdiff - lib-src/b2m.pl
Version 3.15
[gnu-emacs] / lib-src / b2m.pl
index 665dfe202d5e45612bead82f40e12596a47f6b4e..225c272587fe27fc2beff011da2341331194bbcf 100644 (file)
@@ -14,7 +14,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 # USA.
 
 # Maintained by Jonathan Kamens <jik@kamens.brookline.ma.us>.
@@ -30,7 +30,7 @@ use Mail::Address;
 use Date::Parse;
 
 my($whoami) = basename $0;
-my($version) = '$Revision: 1.2 $';
+my($version) = '$Revision$';
 my($usage) = "Usage: $whoami [--help] [--version] [--[no]full-headers] [Babyl-file]
 \tBy default, full headers are printed.\n";
 
@@ -80,7 +80,7 @@ while (<>) {
     $labels = $1;
 
     # Strip the integer indicating whether the header is pruned
-    $labels =~ s/^(\d+)[,\s]*//; 
+    $labels =~ s/^(\d+)[,\s]*//;
     $pruned = $1;
 
     s/(?:((?:.+\n)+)\n*)?\*\*\* EOOH \*\*\*\n+// || goto malformatted;
@@ -102,8 +102,9 @@ while (<>) {
        $full_header = $header;
     }
 
-    # End message with a single newline
-    s/\s+$/\n/;
+    # End message with two newlines (some mbox parsers require a blank
+    # line before the next "From " line).
+    s/\s+$/\n\n/;
 
     # Quote "^From "
     s/(^|\n)From /$1>From /g;
@@ -112,7 +113,7 @@ while (<>) {
     $labels =~ s/[,\s]+$//;
     # Now collapse extra commas and whitespace in the remaining label string
     $labels =~ s/[,\s]+/, /g;
-    
+
     foreach my $rmail_header qw(summary-line x-coding-system) {
        $full_header =~ s/(^|\n)$rmail_header:.*\n/$1/i;
     }
@@ -151,3 +152,5 @@ while (<>) {
 }
 
 close(STDOUT) || die "$whoami: Error closing stdout: $!\n";
+
+# arch-tag: 8c7c8ab0-721c-46d7-ba3e-139801240aa8