Skip to content

Commit

Permalink
fix git alias
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jun 17, 2006
1 parent ada7781 commit d849850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d849850

Please sign in to comment.