diff options
author | Eric Wong <e@80x24.org> | 2023-10-11 07:20:53 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-11 22:10:48 +0000 |
commit | 770d8b3f465db89d80922c32d766b022cf4b31ed (patch) | |
tree | 3bd60df35645436d0aaac95227fa372b1e6f73a9 /script/public-inbox-purge | |
parent | 3b7cdd9173bd0d74fc181b05c02d90b320d621ae (diff) | |
download | public-inbox-770d8b3f465db89d80922c32d766b022cf4b31ed.tar.gz |
Aside from our prior import bugs (fixed in a0c07cba0e5d8b6a (mda: drop leading "From " lines again, 2016-06-26)), we'll always have to be dealing with mutt piping messages to us and `git format-patch' output. So just share the regexp so we can use it everywhere. In may be desirable to allow importing messages with a leading "From " line for FUSE, even. Additionally, some instances of this regexp needlessly added optional `\r?' (CR) checks ahead of the `\n' (LF) element; but they're pointless anyways since [^\n]* is enough to exclude all non-LF bytes.
Diffstat (limited to 'script/public-inbox-purge')
-rwxr-xr-x | script/public-inbox-purge | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/public-inbox-purge b/script/public-inbox-purge index 121027cc..8f9b0b16 100755 --- a/script/public-inbox-purge +++ b/script/public-inbox-purge @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # # Used for purging messages entirely from a public-inbox. Currently @@ -34,7 +34,7 @@ my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV, $opt); PublicInbox::AdminEdit::check_editable(\@ibxs); defined(my $data = do { local $/; <STDIN> }) or die "read STDIN: $!\n"; -$data =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; +PublicInbox::Eml::strip_from($data); my $n_purged = 0; foreach my $ibx (@ibxs) { |