From: Paul Tan Date: Sat, 18 Apr 2015 08:48:35 GMT Subject: Re: [PATCH v2 1/7] path.c: implement xdg_config_home() Message-ID: In-Reply-To: Hi, On Fri, Apr 17, 2015 at 5:41 AM, Eric Sunshine wrote: > On Tue, Apr 14, 2015 at 1:28 PM, Paul Tan wrote: >> Below is the fixed patch. I also decided to return NULL if `filename` is >> NULL because such an input usually indicated an uncaught error. > > Unfortunately, this blurs the line between programmer error (passing > NULL for filename) and a user/configuration error (XDG_CONFIG_HOME and > HOME being undefined). If there is indeed no valid interpretation for > filename==NULL, then it may be better to die() or assert() here to > flag the programmer error as early as possible, rather than returning > NULL. I'm inclined to agree, but off the top of my head an API user may wish to do: xdg_config_home(function_which_returns_NULL_on_error()) And wish for the error to propagate, but that may be considered sloppy programming and so it's better to treat a NULL input as a bug. Will fix this by calling assert(). Thanks. Regards, Paul