From: markus schnalke Date: Fri, 10 Feb 2012 13:54:26 +0000 (+0100) Subject: show: Special-cased -show(mime)proc for mhshow: it needs msgs not file args. X-Git-Tag: mmh-thesis-end~319 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=41f62fc47ef6f2d223b7584b3bb912e65a630445 show: Special-cased -show(mime)proc for mhshow: it needs msgs not file args. A similar test had already been there before the last rework. --- diff --git a/uip/show.c b/uip/show.c index 8609293..6e4f316 100644 --- a/uip/show.c +++ b/uip/show.c @@ -272,19 +272,23 @@ go_to_it: ; } /* Set the "proc" */ - if (mime) - proc = showmimeproc; - else - proc = showproc; + proc = (mime) ? showmimeproc : showproc; if (folder && !file) m_putenv("mhfolder", folder); - /* If the "proc" is "mhshow", add "-file" if showing file. */ - if (strcmp(mhbasename(proc), "mhshow") == 0 && file ) { - vec[vecp] = vec[vecp - 1]; - vec[vecp - 1] = "-file"; - vec[++vecp] = NULL; + /* Special-cased because mhshow takes msg not files args. */ + if (strcmp(mhbasename(proc), "mhshow")==0) { + if (file) { + vec[vecp] = vec[vecp - 1]; + vec[vecp - 1] = "-file"; + vec[++vecp] = NULL; + } + vec[vecp++] = concat("+", folder, NULL); + vec[vecp] = NULL; + vec[0] = mhbasename(proc); + execvp(proc, vec); + adios(proc, "unable to exec"); } /* Add the path to the message names. */