aboutsummaryrefslogtreecommitdiff
path: root/repo-config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-05-02 12:54:12 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-02 12:54:12 -0700
commitcfa24e184a67cc36f414d913cf705d31e70a7a1a (patch)
treebe81413ee9d7320aa375ab31ebf1498bf74d4aa9 /repo-config.c
parent746437d534a1fa84e210427a94972ed0c7f34ee5 (diff)
downloadgit-cfa24e184a67cc36f414d913cf705d31e70a7a1a.tar.gz
git-cfa24e184a67cc36f414d913cf705d31e70a7a1a.tar.xz
repo-config: fix segfault with no argument.
An earlier addition of --list feature was carelessly done and caused an invalid access to argv[1] when it was not given. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'repo-config.c')
-rw-r--r--repo-config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/repo-config.c b/repo-config.c
index fa8aba7a1..e35063034 100644
--- a/repo-config.c
+++ b/repo-config.c
@@ -102,15 +102,14 @@ int main(int argc, const char **argv)
type = T_INT;
else if (!strcmp(argv[1], "--bool"))
type = T_BOOL;
+ else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
+ return git_config(show_all_config);
else
break;
argc--;
argv++;
}
- if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
- return git_config(show_all_config);
-
switch (argc) {
case 2:
return get_value(argv[1], NULL);