projects
/
platform
/
upstream
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Imported Upstream version 2.23.2
[platform/upstream/git.git]
/
builtin
/
mailsplit.c
diff --git
a/builtin/mailsplit.c
b/builtin/mailsplit.c
index
3068168
..
664400b
100644
(file)
--- a/
builtin/mailsplit.c
+++ b/
builtin/mailsplit.c
@@
-232,6
+232,16
@@
static int split_mbox(const char *file, const char *dir, int allow_bare,
do {
peek = fgetc(f);
+ if (peek == EOF) {
+ if (f == stdin)
+ /* empty stdin is OK */
+ ret = skip;
+ else {
+ fclose(f);
+ error(_("empty mbox: '%s'"), file);
+ }
+ goto out;
+ }
} while (isspace(peek));
ungetc(peek, f);