summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-31 14:32:18 +0200
committerDenys Vlasenko2017-07-31 14:32:18 +0200
commitd0fff9155bc55d9576be4c6ba5f656f5b4856ac4 (patch)
tree16fb968f08fdf41ab91a5b37a70424b7231954f1
parent75481d363454a3e0640a5bd0f78d2cc4403e6235 (diff)
downloadbusybox-d0fff9155bc55d9576be4c6ba5f656f5b4856ac4.zip
busybox-d0fff9155bc55d9576be4c6ba5f656f5b4856ac4.tar.gz
ash: fix display of ">&-" redirect in job strings
function old new delta cmdtxt 558 569 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 5c2e065..9c61ce6 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4642,6 +4642,10 @@ cmdputs(const char *s)
/* These can only happen inside quotes */
cc[0] = c;
str = cc;
+//FIXME:
+// $ true $$ &
+// $ <cr>
+// [1]+ Done true ${\$} <<=== BUG: ${\$} is not a valid way to write $$ (${$} would be ok)
c = '\\';
break;
default:
@@ -4823,7 +4827,10 @@ cmdtxt(union node *n)
cmdputs(utoa(n->nfile.fd));
cmdputs(p);
if (n->type == NTOFD || n->type == NFROMFD) {
- cmdputs(utoa(n->ndup.dupfd));
+ if (n->ndup.dupfd >= 0)
+ cmdputs(utoa(n->ndup.dupfd));
+ else
+ cmdputs("-");
break;
}
n = n->nfile.fname;