Completely reworked the path convertion functions
[mmh] / sbr / context_read.c
index 0995d4f..4f74499 100644 (file)
@@ -64,13 +64,13 @@ context_read(void)
        */
 
        if ((cp = getenv("MH")) && *cp != '\0') {
-       defpath = path(cp, TFILE);
+               defpath = getcpy(expanddir(cp));
 
-       if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0)
-               adios((char *)0, "`%s' specified by your MH environment variable is not a normal file", cp);
+               if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0)
+                       adios((char *)0, "`%s' specified by your MH environment variable is not a normal file", cp);
 
-       if ((ib = fopen(defpath, "r")) == (FILE *)0)
-               adios((char *)0, "unable to read the `%s' profile specified by your MH environment variable", defpath);
+               if ((ib = fopen(defpath, "r")) == (FILE *)0)
+                       adios((char *)0, "unable to read the `%s' profile specified by your MH environment variable", defpath);
        } else {
                defpath = concat(mypath, "/", mh_profile, NULL);
 
@@ -134,7 +134,7 @@ context_read(void)
                return;
        }
 
-       ctxpath = getcpy(m_maildir(cp));
+       ctxpath = getcpy(toabsdir(cp));
 
        if ((ib = lkfopen(ctxpath, "r"))) {
                readconfig((struct node **) 0, ib, cp, 1);