X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fcontext_read.c;h=4f744997fd03c07b732456645f199c0f12dab1c3;hb=552fd7253e5ee9e554c5c7a8248a6322aa4363bb;hp=ea7d5da851085b57a9dee5de71ae19ea7bc52d86;hpb=714b5c530ece27ea2835a313013f5b770163403c;p=mmh diff --git a/sbr/context_read.c b/sbr/context_read.c index ea7d5da..4f74499 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -44,11 +44,12 @@ context_read(void) return; /* - ** Find user's home directory. Try the HOME environment variable first, + ** Find user's home directory. Try the HOME environment variable first, ** the home directory field in the password file if that's not found. */ if ((mypath = getenv("HOME")) == (char *)0) { - if ((pw = getpwuid(getuid())) == (struct passwd *)0 || *pw->pw_dir == '\0') + if ((pw = getpwuid(getuid())) == (struct passwd *)0 || + *pw->pw_dir == '\0') adios(NULL, "cannot determine your home directory"); else mypath = pw->pw_dir; @@ -63,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); @@ -89,7 +90,8 @@ context_read(void) */ if ((cp = context_find("path")) == (char *)0) - adios(NULL, "Your %s file does not contain a path entry.", defpath); + adios(NULL, "Your %s file does not contain a path entry.", + defpath); if (*cp == '\0') adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath); @@ -104,7 +106,8 @@ context_read(void) adios(nd, "error opening"); cp = concat("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL); if (!getanswer(cp)) - adios(NULL, "unable to access MH-directory \"%s\"", nd); + adios(NULL, "unable to access MH-directory \"%s\"", + nd); free(cp); if (!makedir(nd)) adios(NULL, "unable to create %s", nd); @@ -131,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);