summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-14 13:01:05 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-17 05:34:09 (GMT)
commitd8498500ba5cf348577202e0bb7810cbd68fa120 (patch)
tree7f12efb75c6e3cbab92d092dc28744c4b5889246
parentada7781dc3602e6efc052e5e0da37a63caae0489 (diff)
downloadgit-d8498500ba5cf348577202e0bb7810cbd68fa120.zip
git-d8498500ba5cf348577202e0bb7810cbd68fa120.tar.gz
git-d8498500ba5cf348577202e0bb7810cbd68fa120.tar.bz2
fix git alias
When extra command line arguments are given to a command that was alias-expanded, the code generated a wrong argument list, leaving the original alias in the result, and forgetting to terminate the new argv list. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--git.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/git.c b/git.c
index 9469d44..329ebec 100644
--- a/git.c
+++ b/git.c
@@ -122,9 +122,9 @@ static int handle_alias(int *argcp, const char ***argv)
/* insert after command name */
if (*argcp > 1) {
new_argv = realloc(new_argv, sizeof(char*) *
- (count + *argcp - 1));
- memcpy(new_argv + count, *argv, sizeof(char*) *
- (*argcp - 1));
+ (count + *argcp));
+ memcpy(new_argv + count, *argv + 1,
+ sizeof(char*) * *argcp);
}
*argv = new_argv;