X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fwhatnowproc.c;h=f3c46f84fd9805020c9fd34df35974a0c85881a8;hb=68a686adeb39223a5e1ad35e4a24890ec053679d;hp=1b16e5d67614298a581c428004b24576a127cfa5;hpb=c8195849d2e366c569271abb0f5f60f4ebf0b4d0;p=mmh diff --git a/uip/whatnowproc.c b/uip/whatnowproc.c index 1b16e5d..f3c46f8 100644 --- a/uip/whatnowproc.c +++ b/uip/whatnowproc.c @@ -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,11 +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 : (ed = context_find("editor")) ? - ed : defaulteditor); + unputenv("mheditor"); } snprintf(buffer, sizeof(buffer), "%d", use); m_putenv("mhuse", buffer);