summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2008-11-25 01:34:52 +0000
committerDenis Vlasenko2008-11-25 01:34:52 +0000
commit16898406724b99ec61d16b38393137bddd6ecc25 (patch)
tree02368101658e1d2ae8f04f3adcb1aee9e9d925da
parent8a2f6bfc2fd378e3504b0938582a314c52c9f2af (diff)
downloadbusybox-16898406724b99ec61d16b38393137bddd6ecc25.zip
busybox-16898406724b99ec61d16b38393137bddd6ecc25.tar.gz
ash: fix bad interaction between ash -c '....&' and bash compat
-rw-r--r--shell/ash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index d44de33..55a79a7 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9189,8 +9189,9 @@ preadbuffer(void)
while (g_parsefile->strpush) {
#if ENABLE_ASH_ALIAS
- if (parsenleft == -1 && g_parsefile->strpush->ap &&
- parsenextc[-1] != ' ' && parsenextc[-1] != '\t') {
+ if (parsenleft == -1 && g_parsefile->strpush->ap
+ && parsenextc[-1] != ' ' && parsenextc[-1] != '\t'
+ ) {
return PEOA;
}
#endif
@@ -9314,6 +9315,9 @@ pfgets(char *line, int len)
static void
pungetc(void)
{
+ /* check is needed for ash -c 'echo 5&' + BASH_COMPAT to work */
+ if (parsenleft < 0)
+ return;
parsenleft++;
parsenextc--;
}