]> git.marmaro.de Git - mmh/blobdiff - uip/whatnowproc.c
Renamed -version switch to -Version to remove the conflict with -verbose.
[mmh] / uip / whatnowproc.c
index fbea9416d3e1868003779fc9b7e15f20bb34ea5f..f3c46f84fd9805020c9fd34df35974a0c85881a8 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;
@@ -48,10 +48,12 @@ what_now(char *ed, int nedit, int use, char *file, char *altmsg, int dist,
                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);