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>
This commit is contained in:
4
config.c
4
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)
|
||||
|
Reference in New Issue
Block a user