X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/54fb590089a2bf43d7987861ba57acb17cebc150..bddd9ca00cd2e2e73aded115a59614af3a74a6cb:/uip/mhshowsbr.c?ds=sidebyside diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 11ec02b3..99bb4067 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); @@ -710,7 +714,7 @@ show_multi_aux (CT ct, int alternate, char *cp, struct format *fmt) if ((*p->c_ceopenfnx) (p, &file) == NOTOK) return NOTOK; - p->c_storage = add (file, NULL); + p->c_storage = mh_xstrdup(FENDNULL(file)); if (p->c_showproc && !strcmp (p->c_showproc, "true")) return OK; @@ -1216,7 +1220,7 @@ iconv_start: replace_param(&ct->c_ctinfo.ci_first_pm, &ct->c_ctinfo.ci_last_pm, "charset", dest_charset, 0); - outline = output_params(strlen(TYPE_FIELD) + 1 + strlen(ctline), + outline = output_params(LEN(TYPE_FIELD) + 1 + strlen(ctline), ct->c_ctinfo.ci_first_pm, NULL, 0); if (outline) { ctline = add(outline, ctline);