Removed the altmsglink (named `@') and env var `$editalt' for repl and dist.
[mmh] / uip / whatnowproc.c
index fbea941..e20df68 100644 (file)
@@ -16,7 +16,7 @@
 ** then execs the command.
 */
 int
-what_now(char *ed, int nedit, int use, char *file, char *altmsg, int dist,
+what_now(char *ed, int use, char *file, char *altmsg, int dist,
        struct msgs *mp, char *text, char *cwd)
 {
        int found, k, msgnum, vecp;
@@ -44,14 +44,14 @@ what_now(char *ed, int nedit, int use, char *file, char *altmsg, int dist,
        } else {
                unputenv("mhaltmsg");
        }
-       if ((bp = getenv("mhaltmsg")))/* XXX */
-               m_putenv("editalt", bp);
        snprintf(buffer, sizeof(buffer), "%d", dist);
        m_putenv("mhdist", buffer);
-       if (nedit) {
-               unputenv("mheditor");
+       if (!ed) {
+               m_putenv("mheditor", defaulteditor);
+       } else if (*ed) {
+               m_putenv("mheditor", ed);
        } else {
-               m_putenv("mheditor", ed ? ed : defaulteditor);
+               unputenv("mheditor");
        }
        snprintf(buffer, sizeof(buffer), "%d", use);
        m_putenv("mhuse", buffer);