diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-25 21:17:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-25 21:17:52 +0200 |
commit | 2a6d29ad5ce652c03ed8324a0d14f62594f2dd84 (patch) | |
tree | d290f3f0c703e9af629bf00398780863764278be /shell | |
parent | 579ad107a69690efc17401c487b06e89d9e8a91d (diff) | |
download | busybox-w32-2a6d29ad5ce652c03ed8324a0d14f62594f2dd84.tar.gz busybox-w32-2a6d29ad5ce652c03ed8324a0d14f62594f2dd84.tar.bz2 busybox-w32-2a6d29ad5ce652c03ed8324a0d14f62594f2dd84.zip |
ash: [PARSER] Do not show prompts in expandstr
Upstream patch:
Date: Thu, 27 Dec 2007 13:57:07 +1100
[PARSER] Do not show prompts in expandstr
Once I fixed the previous problem it became apparent that we never dealt
with prompts with new-lines in them correctly. The problem is that we
showed a secondary prompt for each of them.
This patch disables prompt generation in expandstr.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
function old new delta
expandstr 102 127 +25
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 527abc7b1..dc0f60747 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12276,11 +12276,17 @@ static const char * | |||
12276 | expandstr(const char *ps) | 12276 | expandstr(const char *ps) |
12277 | { | 12277 | { |
12278 | union node n; | 12278 | union node n; |
12279 | int saveprompt; | ||
12279 | 12280 | ||
12280 | /* XXX Fix (char *) cast. It _is_ a bug. ps is variable's value, | 12281 | /* XXX Fix (char *) cast. It _is_ a bug. ps is variable's value, |
12281 | * and token processing _can_ alter it (delete NULs etc). */ | 12282 | * and token processing _can_ alter it (delete NULs etc). */ |
12282 | setinputstring((char *)ps); | 12283 | setinputstring((char *)ps); |
12284 | |||
12285 | saveprompt = doprompt; | ||
12286 | doprompt = 0; | ||
12283 | readtoken1(pgetc(), PSSYNTAX, nullstr, 0); | 12287 | readtoken1(pgetc(), PSSYNTAX, nullstr, 0); |
12288 | doprompt = saveprompt; | ||
12289 | |||
12284 | popfile(); | 12290 | popfile(); |
12285 | 12291 | ||
12286 | n.narg.type = NARG; | 12292 | n.narg.type = NARG; |