]> diplodocus.org Git - nmh/blobdiff - uip/mhshowsbr.c
mhbuildsbr.c: Ensure temporary FILE closed regardless of success.
[nmh] / uip / mhshowsbr.c
index 20de87cc6dce222c927801db7e93ef394e2b7bfd..6f8a978f4a8499af145e27cee484749dd35d3cc0 100644 (file)
@@ -344,7 +344,7 @@ show_content_aux (CT ct, int alternate, char *cp, char *cracked, struct format *
 {
     int fd;
     int xstdin = 0, xlist = 0;
 {
     int fd;
     int xstdin = 0, xlist = 0;
-    char *file = NULL, buffer[BUFSIZ];
+    char *file = NULL, buffer[NMH_BUFSIZ];
 
     if (!ct->c_ceopenfnx) {
        if (!alternate)
 
     if (!ct->c_ceopenfnx) {
        if (!alternate)
@@ -499,11 +499,15 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer,
 
        default: {
            int status;
 
        default: {
            int status;
+            char *display_prog = vecp > 2  &&  vec[2][0] != '\0'
+                /* Copy the real display program name.  This relies on the
+                   specific construction of vec[] by argsplit(). */
+                ?  vec[2]
+                :  NULL;
 
 
-           arglist_free(file, vec);
-
-           pidcheck ((status = pidXwait (child_id, NULL)));
+            pidcheck ((status = pidXwait (child_id, display_prog)));
 
 
+            arglist_free(file, vec);
            if (fd != NOTOK)
                (*ct->c_ceclosefnx) (ct);
            return (alternate ? OK : status);
            if (fd != NOTOK)
                (*ct->c_ceclosefnx) (ct);
            return (alternate ? OK : status);