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>
Junio C Hamano committed
May 28, 2007 at 15:48 UTC
b33271808ba3fdbad66cfc3827b8849a1f3095bc
1 file changed
+4
-2
builtin-mailsplit.c
+4
-2
@@ -261,7 +261,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
261
error("cannot split patches from stdin");
262
return 1;
263
}
264
- num += ret;
264
+ num += (ret - nr);
265
+ nr = ret;
266
continue;
267
}
268
@@ -279,7 +280,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
280
error("cannot split patches from %s", arg);
281
return 1;
282
}
282
- num += ret;
283
+ num += (ret - nr);
284
+ nr = ret;
285
}
286
287
printf("%d\n", num);