Mercurial > emacs
comparison lib-src/b2m.pl @ 48810:1626973bdb2b
Make sure every message ends with a blank line, because some mbox parsers
require a blank line before "From " lines.
author | Pavel Janík <Pavel@Janik.cz> |
---|---|
date | Wed, 11 Dec 2002 23:31:53 +0000 |
parents | 7c794ace9e1a |
children | 23a1cea22d13 |
comparison
equal
deleted
inserted
replaced
48809:31f6d22dc374 | 48810:1626973bdb2b |
---|---|
28 use Getopt::Long; | 28 use Getopt::Long; |
29 use Mail::Address; | 29 use Mail::Address; |
30 use Date::Parse; | 30 use Date::Parse; |
31 | 31 |
32 my($whoami) = basename $0; | 32 my($whoami) = basename $0; |
33 my($version) = '$Revision: 1.2 $'; | 33 my($version) = '$Revision: 1.3 $'; |
34 my($usage) = "Usage: $whoami [--help] [--version] [--[no]full-headers] [Babyl-file] | 34 my($usage) = "Usage: $whoami [--help] [--version] [--[no]full-headers] [Babyl-file] |
35 \tBy default, full headers are printed.\n"; | 35 \tBy default, full headers are printed.\n"; |
36 | 36 |
37 my($opt_help, $opt_version); | 37 my($opt_help, $opt_version); |
38 my($opt_full_headers) = 1; | 38 my($opt_full_headers) = 1; |
100 # that the header was not pruned. | 100 # that the header was not pruned. |
101 if ((! $full_header) || ($pruned eq '0')) { | 101 if ((! $full_header) || ($pruned eq '0')) { |
102 $full_header = $header; | 102 $full_header = $header; |
103 } | 103 } |
104 | 104 |
105 # End message with a single newline | 105 # End message with two newlines (some mbox parsers require a blank |
106 s/\s+$/\n/; | 106 # line before the next "From " line). |
107 s/\s+$/\n\n/; | |
107 | 108 |
108 # Quote "^From " | 109 # Quote "^From " |
109 s/(^|\n)From /$1>From /g; | 110 s/(^|\n)From /$1>From /g; |
110 | 111 |
111 # Strip extra commas and whitespace from the end | 112 # Strip extra commas and whitespace from the end |