mailsplit: allow empty input from stdin
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
013049c985
commit
6f2eacfeb2
@ -169,8 +169,11 @@ int main(int argc, const char **argv)
|
|||||||
if ( !f )
|
if ( !f )
|
||||||
die ("cannot open mbox %s", file);
|
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);
|
die("cannot read mbox %s", file);
|
||||||
|
}
|
||||||
|
|
||||||
while (!file_done) {
|
while (!file_done) {
|
||||||
sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);
|
sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user