summaryrefslogtreecommitdiffstats
path: root/builtin-mailsplit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-05-29 00:48:07 +0200
committerJunio C Hamano <junkio@cox.net>2007-05-29 09:27:06 +0200
commitb33271808ba3fdbad66cfc3827b8849a1f3095bc (patch)
treed6d960da12c81b51033bd1031750c21247edd106 /builtin-mailsplit.c
parentMake the pack-refs interfaces usable from outside (diff)
downloadgit-b33271808ba3fdbad66cfc3827b8849a1f3095bc.tar.xz
git-b33271808ba3fdbad66cfc3827b8849a1f3095bc.zip
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>
Diffstat (limited to 'builtin-mailsplit.c')
-rw-r--r--builtin-mailsplit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index 97ae004ab7..c938425555 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);