From: markus schnalke Date: Sat, 24 Mar 2012 10:04:47 +0000 (+0100) Subject: etcpath(): The unchanged argument is the ultimate fall-back. X-Git-Tag: mmh-thesis-end~210 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=fac725ffc663490c44a7e6930a35402834869402;p=mmh etcpath(): The unchanged argument is the ultimate fall-back. --- diff --git a/sbr/path.c b/sbr/path.c index 27af5b3..21796a7 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -18,6 +18,7 @@ ** 2) Next, if already absolute pathname, then leave unchanged. ** 3) Next, check in mmh directory. ** 4) Next, check in mmh `etc' directory. +** 5) As fall-back, return `file' unchanged. */ char * etcpath(char *file) @@ -65,9 +66,11 @@ try_it: /* Check nmh `etc' directory */ snprintf(epath, sizeof epath, "%s/%s", mhetcdir, file); - return (access(epath, R_OK) != NOTOK ? epath : file); + if (access(epath, R_OK) != NOTOK) + return epath; - /* TODO: What is the ultimate fallback? NULL or file? */ + /* The fall-back */ + return file; }