aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-10 18:27:50 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-10 18:27:50 +0000
commit2e76c3f9016f674dad7a38ec7ba5b068d233f189 (patch)
tree6c9f4604f34ea3b0ca2eceac08d665eca467bfde /shell
parent895bea23032221bcc158f447f81abacd046f87b1 (diff)
downloadbusybox-w32-2e76c3f9016f674dad7a38ec7ba5b068d233f189.tar.gz
busybox-w32-2e76c3f9016f674dad7a38ec7ba5b068d233f189.tar.bz2
busybox-w32-2e76c3f9016f674dad7a38ec7ba5b068d233f189.zip
hush: fix yet another fallout
hush: move fixed testsuites out of hush-bugs/*
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c25
-rw-r--r--shell/hush_test/hush-psubst/tick.right (renamed from shell/hush_test/hush-bugs/tick.right)0
-rwxr-xr-xshell/hush_test/hush-psubst/tick.tests (renamed from shell/hush_test/hush-bugs/tick.tests)0
-rw-r--r--shell/hush_test/hush-psubst/tick2.right (renamed from shell/hush_test/hush-bugs/tick2.right)0
-rwxr-xr-xshell/hush_test/hush-psubst/tick2.tests (renamed from shell/hush_test/hush-bugs/tick2.tests)1
5 files changed, 12 insertions, 14 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 603e19fe9..82bad664d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2691,19 +2691,18 @@ static int expand_vars_to_list(o_string *output, int n, char *arg, char or_mask)
2691 arg = ++p; 2691 arg = ++p;
2692 } /* end of "while (SPECIAL_VAR_SYMBOL is found) ..." */ 2692 } /* end of "while (SPECIAL_VAR_SYMBOL is found) ..." */
2693 2693
2694 { 2694 if (arg[0]) {
2695 int len = strlen(arg); 2695 o_debug_list("expand_vars_to_list[a]", output, n);
2696 if (len) { 2696 o_addstr(output, arg, strlen(arg) + 1);
2697 o_debug_list("expand_vars_to_list[a]", output, n); 2697 o_debug_list("expand_vars_to_list[b]", output, n);
2698 o_addstr(output, arg, len + 1); 2698 } else if (output->length == o_get_last_ptr(output, n) /* expansion is empty */
2699 o_debug_list("expand_vars_to_list[b]", output, n); 2699 && !(ored_ch & 0x80) /* and all vars were not quoted. */
2700 } else if (output->length == o_get_last_ptr(output, n)) { /* expansion is empty */ 2700 ) {
2701 if (!(ored_ch & 0x80)) { /* all vars were not quoted... */ 2701 n--;
2702 n--; 2702 /* allow to reuse list[n] later without re-growth */
2703 /* allow to reuse list[n] later without re-growth */ 2703 output->has_empty_slot = 1;
2704 output->has_empty_slot = 1; 2704 } else {
2705 } 2705 o_addchr(output, '\0');
2706 }
2707 } 2706 }
2708 return n; 2707 return n;
2709} 2708}
diff --git a/shell/hush_test/hush-bugs/tick.right b/shell/hush_test/hush-psubst/tick.right
index 6ed281c75..6ed281c75 100644
--- a/shell/hush_test/hush-bugs/tick.right
+++ b/shell/hush_test/hush-psubst/tick.right
diff --git a/shell/hush_test/hush-bugs/tick.tests b/shell/hush_test/hush-psubst/tick.tests
index 1f749a9cd..1f749a9cd 100755
--- a/shell/hush_test/hush-bugs/tick.tests
+++ b/shell/hush_test/hush-psubst/tick.tests
diff --git a/shell/hush_test/hush-bugs/tick2.right b/shell/hush_test/hush-psubst/tick2.right
index 216c883b8..216c883b8 100644
--- a/shell/hush_test/hush-bugs/tick2.right
+++ b/shell/hush_test/hush-psubst/tick2.right
diff --git a/shell/hush_test/hush-bugs/tick2.tests b/shell/hush_test/hush-psubst/tick2.tests
index dc518057c..db4e944fe 100755
--- a/shell/hush_test/hush-bugs/tick2.tests
+++ b/shell/hush_test/hush-psubst/tick2.tests
@@ -1,4 +1,3 @@
1# Bag: backticks are executed even inside not-taken if
2if false; then 1if false; then
3 echo "FOO" 2 echo "FOO"
4 tmp=`echo BAR >&2` 3 tmp=`echo BAR >&2`