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>
This commit is contained in:
@ -12276,11 +12276,17 @@ static const char *
|
|||||||
expandstr(const char *ps)
|
expandstr(const char *ps)
|
||||||
{
|
{
|
||||||
union node n;
|
union node n;
|
||||||
|
int saveprompt;
|
||||||
|
|
||||||
/* XXX Fix (char *) cast. It _is_ a bug. ps is variable's value,
|
/* XXX Fix (char *) cast. It _is_ a bug. ps is variable's value,
|
||||||
* and token processing _can_ alter it (delete NULs etc). */
|
* and token processing _can_ alter it (delete NULs etc). */
|
||||||
setinputstring((char *)ps);
|
setinputstring((char *)ps);
|
||||||
|
|
||||||
|
saveprompt = doprompt;
|
||||||
|
doprompt = 0;
|
||||||
readtoken1(pgetc(), PSSYNTAX, nullstr, 0);
|
readtoken1(pgetc(), PSSYNTAX, nullstr, 0);
|
||||||
|
doprompt = saveprompt;
|
||||||
|
|
||||||
popfile();
|
popfile();
|
||||||
|
|
||||||
n.narg.type = NARG;
|
n.narg.type = NARG;
|
||||||
|
Reference in New Issue
Block a user