summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-02-11 10:59:17 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-02-11 13:11:37 -0800
commite098368b5b990eb05cbc60a271ab6d731820e0c2 (patch)
tree7583401a48924356f9d9c92204d891eb66a7a299
parenthttp.c: guard config parser from value=NULL (diff)
downloadtgif-e098368b5b990eb05cbc60a271ab6d731820e0c2.tar.xz
merge-recursive.c: guard config parser from value=NULL
merge.default, merge.*.{name,driver} expect a string value Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--merge-recursive.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index c292a77a81..34e3167caf 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -844,8 +844,9 @@ static int read_merge_config(const char *var, const char *value)
int namelen;
if (!strcmp(var, "merge.default")) {
- if (value)
- default_ll_merge = strdup(value);
+ if (!value)
+ return config_error_nonbool(var);
+ default_ll_merge = strdup(value);
return 0;
}
@@ -878,14 +879,14 @@ static int read_merge_config(const char *var, const char *value)
if (!strcmp("name", ep)) {
if (!value)
- return error("%s: lacks value", var);
+ return config_error_nonbool(var);
fn->description = strdup(value);
return 0;
}
if (!strcmp("driver", ep)) {
if (!value)
- return error("%s: lacks value", var);
+ return config_error_nonbool(var);
/*
* merge.<name>.driver specifies the command line:
*
@@ -908,7 +909,7 @@ static int read_merge_config(const char *var, const char *value)
if (!strcmp("recursive", ep)) {
if (!value)
- return error("%s: lacks value", var);
+ return config_error_nonbool(var);
fn->recursive = strdup(value);
return 0;
}