From: Christian Couder Date: Sat, 09 Feb 2008 05:41:19 GMT Subject: Re: [Janitors] value could be NULL in config parser Message-ID: <200802090641.20171.chriscool@tuxfamily.org> In-Reply-To: <5d46db230802081720x122a807do6c63b6b3e435b4c5@mail.gmail.com> Le samedi 9 février 2008, Govind Salinas a écrit : > On 2/8/08, Junio C Hamano wrote: > > If you want to fix them (you do not have to do all of them, and > > if you would like to help, please make one patch per function > > fixed), the procedure is: > > I think I got all the erroneous ones. I did > > find . -name "*.c" | xargs grep git_config\( | awk '{ idx = index($2, > ")"); p = substr($2, 12, idx - 12); print p }' | sort | uniq -u > > To try and get a list of all the ones that might need updating. Thanks. > I did > notice that most functions never check value for null, but they don't > directly access them. They pass them off to other methods. As far as > I can tell, some of these methods don't validate the NULL. So they > will need to be updated. > > Question. Wouldn't it reduce the amount of validation we have to do > if whoever is calling back checked null and assigned an empty string? > If so, we can probably replace all these patches with one patch. This was discussed in this thread: http://thread.gmane.org/gmane.comp.version-control.git/72107/ In short we can't do that now, but it may be possible latter, if we first deprecate using an empty string as boolean value "false" (while a NULL is boolean value "true"). Christian.