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