From: Christian Couder Date: Mon, 11 Feb 2008 04:55:19 GMT Subject: Re: [PATCH] diff.c: guard config parser from value=NULL Message-ID: <200802110555.19383.chriscool@tuxfamily.org> In-Reply-To: <20080210190145.GB5129@artemis.madism.org> Le dimanche 10 février 2008, Pierre Habouzit a écrit : > On Sun, Feb 10, 2008 at 06:35:34PM +0000, Christian Couder wrote: > > +static int xstrdup_confval(const char *dest, const char *var, const > > char *value) > > Why not calling that "git_config_string" in config.[hc] and be > API-consistent ? In this function, there is: if (!value || !*value) return error("%s: lacks value", var); but in some places an empty string is not an error, and in some other places we "die" in case of error instead of using "return error..." So I am not sure this function can be generally usefull as it is now. Maybe I should add a flag parameter to control if we should "die" or "return error" and if we should accept an empty string or not. What do you think ? Christian.