]> diplodocus.org Git - nmh/blobdiff - uip/mhshowsbr.c
Make sure to mark the sequence file as closed in the msgs struct.
[nmh] / uip / mhshowsbr.c
index 80fc9eb37e9576a1ff9df755e5bea81d5bab56c0..db804cb744d342749da8ec2c65daf064836b2373 100644 (file)
@@ -168,30 +168,30 @@ DisplayMsgHeader (CT ct, char *form)
 {
     pid_t child_id;
     int i, vecp;
 {
     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) {
 
     /*
      * If we've specified -(no)moreproc,
      * then just pass that along.
      */
     if (nomore) {
-       vec[vecp++] = "-nomoreproc";
+       vec[vecp++] = getcpy("-nomoreproc");
     } else if (progsw) {
     } else if (progsw) {
-       vec[vecp++] = "-moreproc";
-       vec[vecp++] = progsw;
+       vec[vecp++] = getcpy("-moreproc");
+       vec[vecp++] = getcpy(progsw);
     }
     vec[vecp] = NULL;
 
     fflush (stdout);
 
     }
     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) {
        sleep (5);
 
     switch (child_id) {
@@ -200,7 +200,7 @@ DisplayMsgHeader (CT ct, char *form)
        /* NOTREACHED */
 
     case OK:
        /* NOTREACHED */
 
     case OK:
-       execvp (mhlproc, vec);
+       execvp (file, vec);
        fprintf (stderr, "unable to exec ");
        perror (mhlproc);
        _exit (-1);
        fprintf (stderr, "unable to exec ");
        perror (mhlproc);
        _exit (-1);
@@ -210,6 +210,8 @@ DisplayMsgHeader (CT ct, char *form)
        xpid = -child_id;
        break;
     }
        xpid = -child_id;
        break;
     }
+
+    arglist_free(file, vec);
 }
 
 
 }
 
 
@@ -558,7 +560,7 @@ show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer
 
     fflush (stdout);
 
 
     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:
        sleep (5);
     switch (child_id) {
        case NOTOK:
@@ -1069,11 +1071,6 @@ show_external (CT ct, int serial, int alternate)
        return OK;
 
     return show_switch (p, serial, alternate);
        return OK;
 
     return show_switch (p, serial, alternate);
-
-#if 0
-    content_error (NULL, p, "don't know how to display content");
-    return NOTOK;
-#endif
 }
 
 
 }