Skip to content

Commit

Permalink
mailsplit: fix for more than one input files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 29, 2007
1 parent 99b5a79 commit b332718
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builtin-mailsplit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit b332718

Please sign in to comment.