summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-13 19:11:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-13 19:11:11 (GMT)
commitc35b0b5884a12685aa794e00f51bc7dfaa0dd91c (patch)
treef1e76be5163a7bc4606380ebf3cff7922f18d27d /config.c
parentf43e2fd43b50d5a82a34bb3e4f848cb38bf93b7f (diff)
downloadgit-c35b0b5884a12685aa794e00f51bc7dfaa0dd91c.zip
git-c35b0b5884a12685aa794e00f51bc7dfaa0dd91c.tar.gz
git-c35b0b5884a12685aa794e00f51bc7dfaa0dd91c.tar.bz2
Fix git_config_bool_or_int
The earlier one botched the return value logic between config_bool and config_bool_and_int. The former should normalize between 0 and 1 while the latter should give back full range of integer values. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index 5ea18ef..b0ada51 100644
--- a/config.c
+++ b/config.c
@@ -315,13 +315,13 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
if (!strcasecmp(value, "false") || !strcasecmp(value, "no"))
return 0;
*is_bool = 0;
- return git_config_int(name, value) != 0;
+ return git_config_int(name, value);
}
int git_config_bool(const char *name, const char *value)
{
int discard;
- return git_config_bool_or_int(name, value, &discard);
+ return !!git_config_bool_or_int(name, value, &discard);
}
int git_config_string(const char **dest, const char *var, const char *value)