X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=mailsplit.c;h=14c1358734c5434ed5611f77f67ee31ff8cdb0d2;hb=5df9140c92349a807952628a04ee94b65c5bead5;hp=eb58b1ebe430a1a1acf189097c5277545e3b67e9;hpb=9a26dbd120110ad4e07d3047abc13d615183c8ec;p=git.git diff --git a/mailsplit.c b/mailsplit.c index eb58b1eb..14c13587 100644 --- a/mailsplit.c +++ b/mailsplit.c @@ -169,8 +169,11 @@ int main(int argc, const char **argv) if ( !f ) die ("cannot open mbox %s", file); - if (fgets(buf, sizeof(buf), f) == NULL) + if (fgets(buf, sizeof(buf), f) == NULL) { + if (f == stdin) + break; /* empty stdin is OK */ die("cannot read mbox %s", file); + } while (!file_done) { sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);