svn commit: trunk/busybox/shell

vda at busybox.net vda at busybox.net
Tue Nov 25 01:34:53 UTC 2008


Author: vda
Date: 2008-11-24 17:34:52 -0800 (Mon, 24 Nov 2008)
New Revision: 24136

Log:
ash: fix bad interaction between ash -c '....&' and bash compat



Modified:
   trunk/busybox/shell/ash.c


Changeset:
Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2008-11-24 22:34:47 UTC (rev 24135)
+++ trunk/busybox/shell/ash.c	2008-11-25 01:34:52 UTC (rev 24136)
@@ -9189,8 +9189,9 @@
 
 	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 @@
 static void
 pungetc(void)
 {
+	/* check is needed for ash -c 'echo 5&' + BASH_COMPAT to work */
+	if (parsenleft < 0)
+		return;
 	parsenleft++;
 	parsenextc--;
 }




More information about the busybox-cvs mailing list