Print out commands with NTOFD/NFROMFD redirections that close the
descriptors (">&-" or similar) correctly in the jobs(1) command.
This commit is contained in:
parent
518b7839f2
commit
907354479f
@ -1229,7 +1229,10 @@ cmdtxt(union node *n)
|
||||
}
|
||||
cmdputs(p);
|
||||
if (n->type == NTOFD || n->type == NFROMFD) {
|
||||
s[0] = n->ndup.dupfd + '0';
|
||||
if (n->ndup.dupfd >= 0)
|
||||
s[0] = n->ndup.dupfd + '0';
|
||||
else
|
||||
s[0] = '-';
|
||||
s[1] = '\0';
|
||||
cmdputs(s);
|
||||
} else {
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user