On Wed, Feb 17, 2010 at 02:08, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> diff --git a/config.c b/config.c
> index 6963fbe..6642d30 100644
> --- a/config.c
> +++ b/config.c
> @@ -322,9 +322,8 @@ unsigned long git_config_ulong(const char *name, const char *value)
> return ret;
> }
>
> -int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
> +int git_config_maybe_bool(const char *name, const char *value)
> {
> - *is_bool = 1;
> if (!value)
> return 1;
> if (!*value)
> @@ -333,7 +332,14 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
> return 1;
> if (!strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "off"))
> return 0;
> - *is_bool = 0;
> + return -1;
> +}
> +
> +int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
> +{
> + int v = git_config_maybe_bool(name, value);
> + if (0 <= v)
> + return v;
> return git_config_int(name, value);
> }