hush: fix yet another fallout

hush: move fixed testsuites out of hush-bugs/*
This commit is contained in:
Denis Vlasenko 2008-06-10 18:27:50 +00:00
parent 895bea2303
commit 2e76c3f901
5 changed files with 12 additions and 14 deletions

View File

@ -2691,19 +2691,18 @@ static int expand_vars_to_list(o_string *output, int n, char *arg, char or_mask)
arg = ++p; arg = ++p;
} /* end of "while (SPECIAL_VAR_SYMBOL is found) ..." */ } /* end of "while (SPECIAL_VAR_SYMBOL is found) ..." */
{ if (arg[0]) {
int len = strlen(arg); o_debug_list("expand_vars_to_list[a]", output, n);
if (len) { o_addstr(output, arg, strlen(arg) + 1);
o_debug_list("expand_vars_to_list[a]", output, n); o_debug_list("expand_vars_to_list[b]", output, n);
o_addstr(output, arg, len + 1); } else if (output->length == o_get_last_ptr(output, n) /* expansion is empty */
o_debug_list("expand_vars_to_list[b]", output, n); && !(ored_ch & 0x80) /* and all vars were not quoted. */
} else if (output->length == o_get_last_ptr(output, n)) { /* expansion is empty */ ) {
if (!(ored_ch & 0x80)) { /* all vars were not quoted... */ n--;
n--; /* allow to reuse list[n] later without re-growth */
/* allow to reuse list[n] later without re-growth */ output->has_empty_slot = 1;
output->has_empty_slot = 1; } else {
} o_addchr(output, '\0');
}
} }
return n; return n;
} }

View File

@ -1,4 +1,3 @@
# Bag: backticks are executed even inside not-taken if
if false; then if false; then
echo "FOO" echo "FOO"
tmp=`echo BAR >&2` tmp=`echo BAR >&2`