X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/54fb590089a2bf43d7987861ba57acb17cebc150..f2552a93d977406ed401dc206d7af889e5840f6e:/uip/mhshowsbr.c diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 11ec02b3..6f8a978f 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -499,11 +499,15 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, 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);