Skip to content

Commit b332718

Browse files
author
Junio C Hamano
committed
mailsplit: fix for more than one input files
Earlier commit d63bd9a broke the case where more than one input files are fed to mailsplit by not incrementing the base counter when splitting second and subsequent input files. This should fix it. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 99b5a79 commit b332718

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin-mailsplit.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
261261
error("cannot split patches from stdin");
262262
return 1;
263263
}
264-
num += ret;
264+
num += (ret - nr);
265+
nr = ret;
265266
continue;
266267
}
267268

@@ -279,7 +280,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
279280
error("cannot split patches from %s", arg);
280281
return 1;
281282
}
282-
num += ret;
283+
num += (ret - nr);
284+
nr = ret;
283285
}
284286

285287
printf("%d\n", num);

0 commit comments

Comments
 (0)