diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index 10fa1773401d6474d8e6c88065e3a992690ae0f8..46b27cdaea71cba92974480da74ec5922fcf3a7a 100644 (file)
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
{
char name[PATH_MAX];
int ret = -1;
+ int peek;
FILE *f = !strcmp(file, "-") ? stdin : fopen(file, "r");
int file_done = 0;
goto out;
}
+ do {
+ peek = fgetc(f);
+ } while (isspace(peek));
+ ungetc(peek, f);
+
if (fgets(buf, sizeof(buf), f) == NULL) {
/* empty stdin is OK */
if (f != stdin) {