summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ada7781)
raw | patch | inline | side by side (parent: ada7781)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Jun 2006 13:01:05 +0000 (06:01 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 17 Jun 2006 05:34:09 +0000 (22:34 -0700) |
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>
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>
git.c | patch | blob | history |
index 9469d44b4bcb459f61839103a8650cb6965f88a9..329ebec78cd057a14a22cca2e89a9cb09a53f5dd 100644 (file)
--- a/git.c
+++ b/git.c
/* 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;