X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiInput.pm;h=8708356491965cbb1214c76d2d2249408b927430;hb=cf0c7ce3ce81b5c33cb149a7edc3efd99631a57d;hp=46eea1118394abb2af004f13870a5f67d450a05c;hpb=40f3f2a2c805fc37c7ed35a60948856bd962b493;p=public-inbox.git diff --git a/lib/PublicInbox/LeiInput.pm b/lib/PublicInbox/LeiInput.pm index 46eea111..87083564 100644 --- a/lib/PublicInbox/LeiInput.pm +++ b/lib/PublicInbox/LeiInput.pm @@ -69,6 +69,12 @@ error reading $name: $! # but no Content-Length or "From " escaping. # "git format-patch" also generates such files by default. $buf =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; + + # a user may feed just a body: git diff | lei rediff -U9 + if ($self->{-force_eml}) { + my $eml = PublicInbox::Eml->new($buf); + substr($buf, 0, 0) = "\n\n" if !$eml->{bdy}; + } $self->input_eml_cb(PublicInbox::Eml->new(\$buf), @args); } else { # prepare_inputs already validated $ifmt