}
/* 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. */