Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mailsplit: allow empty input from stdin
author
Junio C Hamano
<junkio@cox.net>
Sun, 8 Jan 2006 05:26:30 +0000
(21:26 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 8 Jan 2006 05:26:30 +0000
(21:26 -0800)
Signed-off-by: Junio C Hamano <junkio@cox.net>
mailsplit.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
013049c
)
diff --git
a/mailsplit.c
b/mailsplit.c
index eb58b1ebe430a1a1acf189097c5277545e3b67e9..14c1358734c5434ed5611f77f67ee31ff8cdb0d2 100644
(file)
--- 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);