X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1c91be5784ddebaa6a54f1f2c42a8016f10af6de..9a6d835cfe7761f6a85f84233d9d93722efe6ecc:/sbr/context_read.c diff --git a/sbr/context_read.c b/sbr/context_read.c index 8f63fedf..de14b0d5 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -65,6 +65,8 @@ context_read (void) if ((cp = getenv("MH")) && *cp != '\0') { defpath = path(cp, TFILE); + /* defpath is an absolute path; make sure that always MH is, too. */ + setenv("MH", defpath, 1); 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); @@ -105,7 +107,7 @@ context_read (void) cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL); - if (!getanswer(cp)) + if (!read_yes_or_no_if_tty(cp)) adios (NULL, "unable to access MH-directory \"%s\"", nd); free (cp);