From: Junio C Hamano Date: Mon, 28 May 2007 22:48:07 +0000 (-0700) Subject: mailsplit: fix for more than one input files X-Git-Tag: v1.5.3-rc0~193 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b33271808ba3fdbad66cfc3827b8849a1f3095bc;p=git.git 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 --- diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c index 97ae004ab..c93842555 100644 --- a/builtin-mailsplit.c +++ b/builtin-mailsplit.c @@ -261,7 +261,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix) error("cannot split patches from stdin"); return 1; } - num += ret; + num += (ret - nr); + nr = ret; continue; } @@ -279,7 +280,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix) error("cannot split patches from %s", arg); return 1; } - num += ret; + num += (ret - nr); + nr = ret; } printf("%d\n", num);