diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-09 03:26:47 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-09 03:26:47 +0000 |
commit | 284f7b18517c1ae9289b5c527797519a64b1ab39 (patch) | |
tree | ea3a229fface84e43ad810146281b13aef78af32 /bin/sh/show.c | |
parent | 6eb4916dee42174b74d9d3077dd3a4b594452e66 (diff) | |
download | FreeBSD-src-284f7b18517c1ae9289b5c527797519a64b1ab39.zip FreeBSD-src-284f7b18517c1ae9289b5c527797519a64b1ab39.tar.gz |
Print out commands with NTOFD/NFROMFD redirections that close the
descriptors (">&-" or similar) correctly in the jobs(1) command.
Diffstat (limited to 'bin/sh/show.c')
-rw-r--r-- | bin/sh/show.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); } |