commit | 6f2eacfeb2c67a7e05f98df2288d7893d3368c8e | [log] [tgz] |
---|---|---|
author | Junio C Hamano <junkio@cox.net> | Sat Jan 07 21:26:30 2006 -0800 |
committer | Junio C Hamano <junkio@cox.net> | Sat Jan 07 21:26:30 2006 -0800 |
tree | 99a28e9b0cb68552be8162f60539254e3984a4eb | |
parent | 013049c985e4095106e545559c17bc594d56468d [diff] |
mailsplit: allow empty input from stdin Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/mailsplit.c b/mailsplit.c index eb58b1e..14c1358 100644 --- a/mailsplit.c +++ b/mailsplit.c
@@ -169,8 +169,11 @@ 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);