X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fpath.c;h=e5576b89c119298e375ef29af29f8398932af241;hp=fd05f3469d955ea9f97639e7a325950365895e9b;hb=7030d7edb099bff36ded7548bb5380f7acab4f9b;hpb=8971a6f1301b3220c4d4b7e729772420cfcd2b53 diff --git a/sbr/path.c b/sbr/path.c index fd05f34..e5576b8 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -9,8 +9,6 @@ #include #include -extern char *mhetcdir; - /* ** Find the location of a format or configuration @@ -18,8 +16,8 @@ extern char *mhetcdir; ** ** 1) If it begins with ~user, then expand it. ** 2) Next, if already absolute pathname, then leave unchanged. -** 3) Next, check in nmh Mail directory. -** 4) Next, check in nmh `etc' directory. +** 3) Next, check in mmh directory. +** 4) Next, check in mmh `etc' directory. */ char * etcpath(char *file) @@ -29,7 +27,7 @@ etcpath(char *file) char *pp; struct passwd *pw; - context_read(); + /* XXX: here was: ``context_read();'' -- why? */ if (*file == '~') { /* Expand `~user' */ if ((cp = strchr(pp = file + 1, '/'))) @@ -60,14 +58,16 @@ try_it: return file; } - /* Check nmh Mail directory */ - strncpy(epath, toabsdir(file), sizeof epath); + /* Check mmh directory */ + snprintf(epath, sizeof epath, "%s/%s", mmhpath, file); if (access(epath, R_OK) != NOTOK) return epath; /* Check nmh `etc' directory */ snprintf(epath, sizeof epath, "%s/%s", mhetcdir, file); return (access(epath, R_OK) != NOTOK ? epath : file); + + /* TODO: What is the ultimate fallback? NULL or file? */ }