projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'jc/name' into next
[git.git]
/
mailsplit.c
diff --git
a/mailsplit.c
b/mailsplit.c
index
eb58b1e
..
c529e2d
100644
(file)
--- a/
mailsplit.c
+++ b/
mailsplit.c
@@
-11,7
+11,6
@@
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
-#include <assert.h>
#include "cache.h"
static const char git_mailsplit_usage[] =
#include "cache.h"
static const char git_mailsplit_usage[] =
@@
-169,8
+168,11
@@
int main(int argc, const char **argv)
if ( !f )
die ("cannot open mbox %s", file);
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);
die("cannot read mbox %s", file);
+ }
while (!file_done) {
sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);
while (!file_done) {
sprintf(name, "%s/%0*d", dir, nr_prec, ++nr);