From: Junio C Hamano Date: Wed, 14 Jun 2006 13:01:05 +0000 (-0700) Subject: fix git alias X-Git-Tag: v1.4.1-rc1~26^2~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d8498500ba5cf348577202e0bb7810cbd68fa120;p=git.git 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 --- diff --git a/git.c b/git.c index 9469d44b4..329ebec78 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;