提交 cfa24e18 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

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