#include <fcntl.h>
#include <h/signals.h>
#include <h/md5.h>
-#include <errno.h>
#include <setjmp.h>
-#include <signal.h>
#include <h/mts.h>
#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
-#include <sys/wait.h>
extern int debugsw;
{
pid_t child_id;
int i, vecp;
- char *vec[8];
+ char **vec;
+ char *file;
- vecp = 0;
- vec[vecp++] = r1bindex (mhlproc, '/');
- vec[vecp++] = "-form";
- vec[vecp++] = form;
- vec[vecp++] = "-nobody";
- vec[vecp++] = ct->c_file;
+ vec = argsplit(mhlproc, &file, &vecp);
+ vec[vecp++] = getcpy("-form");
+ vec[vecp++] = getcpy(form);
+ vec[vecp++] = getcpy("-nobody");
+ vec[vecp++] = getcpy(ct->c_file);
/*
* If we've specified -(no)moreproc,
* then just pass that along.
*/
if (nomore) {
- vec[vecp++] = "-nomoreproc";
+ vec[vecp++] = getcpy("-nomoreproc");
} else if (progsw) {
- vec[vecp++] = "-moreproc";
- vec[vecp++] = progsw;
+ vec[vecp++] = getcpy("-moreproc");
+ vec[vecp++] = getcpy(progsw);
}
vec[vecp] = NULL;
fflush (stdout);
- for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+ for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
sleep (5);
switch (child_id) {
/* NOTREACHED */
case OK:
- execvp (mhlproc, vec);
+ execvp (file, vec);
fprintf (stderr, "unable to exec ");
perror (mhlproc);
_exit (-1);
xpid = -child_id;
break;
}
+
+ arglist_free(file, vec);
}
switch (ct->c_type) {
case CT_MULTIPART:
return show_multi (ct, serial, alternate);
- break;
case CT_MESSAGE:
switch (ct->c_subtype) {
case MESSAGE_PARTIAL:
return show_partial (ct, serial, alternate);
- break;
case MESSAGE_EXTERNAL:
return show_external (ct, serial, alternate);
- break;
case MESSAGE_RFC822:
default:
return show_message_rfc822 (ct, serial, alternate);
- break;
}
- break;
case CT_TEXT:
return show_text (ct, serial, alternate);
- break;
case CT_AUDIO:
case CT_IMAGE:
case CT_VIDEO:
case CT_APPLICATION:
return show_content (ct, serial, alternate);
- break;
default:
adios (NULL, "unknown content type %d", ct->c_type);
- break;
}
return 0; /* NOT REACHED */
fflush (stdout);
- for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+ for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
sleep (5);
switch (child_id) {
case NOTOK:
*/
if (!alternate || ct->c_subtype == TEXT_PLAIN) {
snprintf (buffer, sizeof(buffer), "%%p%s '%%F'", progsw ? progsw :
- moreproc && *moreproc ? moreproc : "more");
+ moreproc && *moreproc ? moreproc : DEFAULT_PAGER);
cp = (ct->c_showproc = add (buffer, NULL));
return show_content_aux (ct, serial, alternate, cp, NULL);
}
return OK;
return show_switch (p, serial, alternate);
-
-#if 0
- content_error (NULL, p, "don't know how to display content");
- return NOTOK;
-#endif
}