From fac725ffc663490c44a7e6930a35402834869402 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 24 Mar 2012 11:04:47 +0100 Subject: [PATCH] etcpath(): The unchanged argument is the ultimate fall-back. --- sbr/path.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 1.7.10.4