From 284f7b18517c1ae9289b5c527797519a64b1ab39 Mon Sep 17 00:00:00 2001 From: tjr Date: Tue, 9 Jul 2002 03:26:47 +0000 Subject: Print out commands with NTOFD/NFROMFD redirections that close the descriptors (">&-" or similar) correctly in the jobs(1) command. --- bin/sh/show.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin/sh/show.c') diff --git a/bin/sh/show.c b/bin/sh/show.c index e6bf574..9baac48 100644 --- a/bin/sh/show.c +++ b/bin/sh/show.c @@ -152,7 +152,10 @@ shcmd(union node *cmd, FILE *fp) fprintf(fp, "%d", np->nfile.fd); fputs(s, fp); if (np->nfile.type == NTOFD || np->nfile.type == NFROMFD) { - fprintf(fp, "%d", np->ndup.dupfd); + if (np->ndup.dupfd >= 0) + fprintf(fp, "%d", np->ndup.dupfd); + else + fprintf(fp, "-"); } else { sharg(np->nfile.fname, fp); } -- cgit v1.1