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>
This commit is contained in:
parent
ada7781dc3
commit
d8498500ba
6
git.c
6
git.c
@ -122,9 +122,9 @@ static int handle_alias(int *argcp, const char ***argv)
|
|||||||
/* insert after command name */
|
/* insert after command name */
|
||||||
if (*argcp > 1) {
|
if (*argcp > 1) {
|
||||||
new_argv = realloc(new_argv, sizeof(char*) *
|
new_argv = realloc(new_argv, sizeof(char*) *
|
||||||
(count + *argcp - 1));
|
(count + *argcp));
|
||||||
memcpy(new_argv + count, *argv, sizeof(char*) *
|
memcpy(new_argv + count, *argv + 1,
|
||||||
(*argcp - 1));
|
sizeof(char*) * *argcp);
|
||||||
}
|
}
|
||||||
|
|
||||||
*argv = new_argv;
|
*argv = new_argv;
|
||||||
|
Loading…
Reference in New Issue
Block a user