svn commit: trunk/busybox/shell: hush_test hush_test/hush-bugs hush_test etc...

vda at busybox.net vda at busybox.net
Tue Jun 10 18:27:55 UTC 2008


Author: vda
Date: 2008-06-10 11:27:50 -0700 (Tue, 10 Jun 2008)
New Revision: 22285

Log:
hush: fix yet another fallout
hush: move fixed testsuites out of hush-bugs/*



Added:
   trunk/busybox/shell/hush_test/hush-psubst/
   trunk/busybox/shell/hush_test/hush-psubst/tick.right
   trunk/busybox/shell/hush_test/hush-psubst/tick.tests
   trunk/busybox/shell/hush_test/hush-psubst/tick2.right
   trunk/busybox/shell/hush_test/hush-psubst/tick2.tests

Removed:
   trunk/busybox/shell/hush_test/hush-bugs/tick.right
   trunk/busybox/shell/hush_test/hush-bugs/tick.tests
   trunk/busybox/shell/hush_test/hush-bugs/tick2.right
   trunk/busybox/shell/hush_test/hush-bugs/tick2.tests

Modified:
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2008-06-10 18:06:24 UTC (rev 22284)
+++ trunk/busybox/shell/hush.c	2008-06-10 18:27:50 UTC (rev 22285)
@@ -2691,19 +2691,18 @@
 		arg = ++p;
 	} /* end of "while (SPECIAL_VAR_SYMBOL is found) ..." */
 
-	{
-		int len = strlen(arg);
-		if (len) {
-			o_debug_list("expand_vars_to_list[a]", output, n);
-			o_addstr(output, arg, len + 1);
-			o_debug_list("expand_vars_to_list[b]", output, n);
-		} else if (output->length == o_get_last_ptr(output, n)) { /* expansion is empty */
-			if (!(ored_ch & 0x80)) { /* all vars were not quoted... */
-				n--;
-				/* allow to reuse list[n] later without re-growth */
-				output->has_empty_slot = 1;
-			}
-		}
+	if (arg[0]) {
+		o_debug_list("expand_vars_to_list[a]", output, n);
+		o_addstr(output, arg, strlen(arg) + 1);
+		o_debug_list("expand_vars_to_list[b]", output, n);
+	} else if (output->length == o_get_last_ptr(output, n) /* expansion is empty */
+	 && !(ored_ch & 0x80) /* and all vars were not quoted. */
+	) {
+		n--;
+		/* allow to reuse list[n] later without re-growth */
+		output->has_empty_slot = 1;
+	} else {
+		o_addchr(output, '\0');
 	}
 	return n;
 }

Deleted: trunk/busybox/shell/hush_test/hush-bugs/tick.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-bugs/tick.right	2008-06-10 18:06:24 UTC (rev 22284)
+++ trunk/busybox/shell/hush_test/hush-bugs/tick.right	2008-06-10 18:27:50 UTC (rev 22285)
@@ -1,2 +0,0 @@
-1
-1

Deleted: trunk/busybox/shell/hush_test/hush-bugs/tick.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-bugs/tick.tests	2008-06-10 18:06:24 UTC (rev 22284)
+++ trunk/busybox/shell/hush_test/hush-bugs/tick.tests	2008-06-10 18:27:50 UTC (rev 22285)
@@ -1,4 +0,0 @@
-true
-false; echo `echo $?`
-true
-{ false; echo `echo $?`; }

Deleted: trunk/busybox/shell/hush_test/hush-bugs/tick2.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-bugs/tick2.right	2008-06-10 18:06:24 UTC (rev 22284)
+++ trunk/busybox/shell/hush_test/hush-bugs/tick2.right	2008-06-10 18:27:50 UTC (rev 22285)
@@ -1 +0,0 @@
-BAZ

Deleted: trunk/busybox/shell/hush_test/hush-bugs/tick2.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-bugs/tick2.tests	2008-06-10 18:06:24 UTC (rev 22284)
+++ trunk/busybox/shell/hush_test/hush-bugs/tick2.tests	2008-06-10 18:27:50 UTC (rev 22285)
@@ -1,6 +0,0 @@
-# Bag: backticks are executed even inside not-taken if
-if false; then
-    echo "FOO"
-    tmp=`echo BAR >&2`
-fi
-echo BAZ

Copied: trunk/busybox/shell/hush_test/hush-psubst/tick.right (from rev 22281, trunk/busybox/shell/hush_test/hush-bugs/tick.right)
===================================================================
--- trunk/busybox/shell/hush_test/hush-psubst/tick.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-psubst/tick.right	2008-06-10 18:27:50 UTC (rev 22285)
@@ -0,0 +1,2 @@
+1
+1

Copied: trunk/busybox/shell/hush_test/hush-psubst/tick.tests (from rev 22281, trunk/busybox/shell/hush_test/hush-bugs/tick.tests)
===================================================================
--- trunk/busybox/shell/hush_test/hush-psubst/tick.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-psubst/tick.tests	2008-06-10 18:27:50 UTC (rev 22285)
@@ -0,0 +1,4 @@
+true
+false; echo `echo $?`
+true
+{ false; echo `echo $?`; }

Copied: trunk/busybox/shell/hush_test/hush-psubst/tick2.right (from rev 22281, trunk/busybox/shell/hush_test/hush-bugs/tick2.right)
===================================================================
--- trunk/busybox/shell/hush_test/hush-psubst/tick2.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-psubst/tick2.right	2008-06-10 18:27:50 UTC (rev 22285)
@@ -0,0 +1 @@
+BAZ

Copied: trunk/busybox/shell/hush_test/hush-psubst/tick2.tests (from rev 22281, trunk/busybox/shell/hush_test/hush-bugs/tick2.tests)
===================================================================
--- trunk/busybox/shell/hush_test/hush-psubst/tick2.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-psubst/tick2.tests	2008-06-10 18:27:50 UTC (rev 22285)
@@ -0,0 +1,5 @@
+if false; then
+    echo "FOO"
+    tmp=`echo BAR >&2`
+fi
+echo BAZ




More information about the busybox-cvs mailing list