From: Ping Yin Date: Sun, 13 Apr 2008 07:30:28 GMT Subject: Re: [PATCH v3 1/4] config.c: Add git_config_bool_or_int to handle bool/int variable Message-ID: <46dff0320804130030q19dd9f23j66d9b7adc7d305d3@mail.gmail.com> In-Reply-To: <7vmynye0cz.fsf@gitster.siamese.dyndns.org> On Sun, Apr 13, 2008 at 2:26 PM, Junio C Hamano wrote: > Ping Yin writes: > -int git_config_bool(const char *name, const char *value) > > +int git_config_bool_or_int(const char *name, const char *value, int *is_bool) > { > + *is_bool = 1; > if (!value) > return 1; > if (!*value) > @@ -313,9 +314,16 @@ int git_config_bool(const char *name, const char *value) > > return 1; > if (!strcasecmp(value, "false") || !strcasecmp(value, "no")) > return 0; > + *is_bool = 0; > > return git_config_int(name, value) != 0; > } Should return an interger if *is_bool==0 s/!=0// > +int git_config_bool(const char *name, const char *value) > +{ > + int discard; > + return git_config_bool_or_int(name, value, &discard); > > > +} > + > int git_config_string(const char **dest, const char *var, const char *value) > { > if (!value) > > -- Ping Yin