parser: Do not print prompt if input buffer is not empty Do not print a prompt if there is still input left over in the input buffer. Add a noinline attribute to setprompt while doing this as otherwise gcc will produce horrendous output. Reported-by: Vincent Lefevre <vincent@vinc17.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/src/parser.c b/src/parser.c index 461afc5..e44b3c3 100644 --- a/src/parser.c +++ b/src/parser.c
@@ -1712,8 +1712,7 @@ /* NOTREACHED */ } -STATIC void -setprompt(int which) +static void __attribute__((noinline)) setprompt(int which) { struct stackmark smark; int show; @@ -1726,7 +1725,7 @@ #else show = !el; #endif - if (show) { + if (show && !parsefile->nleft) { pushstackmark(&smark, stackblocksize()); out2str(getprompt(NULL)); popstackmark(&smark);