diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-21 14:30:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-21 14:30:43 -0800 |
commit | f7d07cce82ccdbc3a7cf343943d359287cb19c5a (patch) | |
tree | c0b4b2d188802f1846dd8d2558e7a5cf033d3ffb /config.c | |
parent | 876e78f31d2aa23e9f669a257ddcbf9a7970a958 (diff) | |
parent | db6195efab70aa3aca1cc8e39855f2cd58e0287b (diff) | |
download | git-f7d07cce82ccdbc3a7cf343943d359287cb19c5a.tar.gz |
Merge branch 'jk/maint-decorate-01-bool'
* jk/maint-decorate-01-bool:
handle arbitrary ints in git_config_maybe_bool
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -429,13 +429,11 @@ static int git_config_maybe_bool_text(const char *name, const char *value) int git_config_maybe_bool(const char *name, const char *value) { - int v = git_config_maybe_bool_text(name, value); + long v = git_config_maybe_bool_text(name, value); if (0 <= v) return v; - if (!strcmp(value, "0")) - return 0; - if (!strcmp(value, "1")) - return 1; + if (git_parse_long(value, &v)) + return !!v; return -1; } |