提交 d8498500 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <junkio@cox.net>
上级 ada7781d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册