diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-12 13:45:45 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-12 13:45:45 +0100 |
commit | b70cef71ebf1e71d147e1dee57134b1ad1da6314 (patch) | |
tree | e05f08a7b4c7d4c07a9becc48fc2d881ff82bfd1 | |
parent | f2c8aa6676ebedc34b2cd5089ce6f13c16db1277 (diff) | |
download | busybox-w32-b70cef71ebf1e71d147e1dee57134b1ad1da6314.tar.gz busybox-w32-b70cef71ebf1e71d147e1dee57134b1ad1da6314.tar.bz2 busybox-w32-b70cef71ebf1e71d147e1dee57134b1ad1da6314.zip |
hush: two NOMMU fixes for bugs 877 and 883
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 15 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/nommu2.right | 5 | ||||
-rwxr-xr-x | shell/hush_test/hush-misc/nommu2.tests | 5 |
3 files changed, 22 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c index d02e68d49..7d851ed97 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -4406,9 +4406,15 @@ static void debug_print_tree(struct pipe *pi, int lvl) | |||
4406 | lvl*2, "", prn, | 4406 | lvl*2, "", prn, |
4407 | command->assignment_cnt); | 4407 | command->assignment_cnt); |
4408 | if (command->group) { | 4408 | if (command->group) { |
4409 | fprintf(stderr, " group %s: (argv=%p)\n", | 4409 | fprintf(stderr, " group %s: (argv=%p)%s%s\n", |
4410 | CMDTYPE[command->cmd_type], | 4410 | CMDTYPE[command->cmd_type], |
4411 | argv); | 4411 | argv |
4412 | #if !BB_MMU | ||
4413 | , " group_as_string:", command->group_as_string | ||
4414 | #else | ||
4415 | , "", "" | ||
4416 | #endif | ||
4417 | ); | ||
4412 | debug_print_tree(command->group, lvl+1); | 4418 | debug_print_tree(command->group, lvl+1); |
4413 | prn++; | 4419 | prn++; |
4414 | continue; | 4420 | continue; |
@@ -5986,7 +5992,7 @@ static int handle_dollar(o_string *as_string, | |||
5986 | # if !BB_MMU | 5992 | # if !BB_MMU |
5987 | if (as_string) { | 5993 | if (as_string) { |
5988 | o_addstr(as_string, dest->data + pos); | 5994 | o_addstr(as_string, dest->data + pos); |
5989 | o_addchr(as_string, '`'); | 5995 | o_addchr(as_string, ')'); |
5990 | } | 5996 | } |
5991 | # endif | 5997 | # endif |
5992 | o_addchr(dest, SPECIAL_VAR_SYMBOL); | 5998 | o_addchr(dest, SPECIAL_VAR_SYMBOL); |
@@ -6535,6 +6541,9 @@ static struct pipe *parse_stream(char **pstring, | |||
6535 | * with redirect_opt_num(), but bash doesn't do it. | 6541 | * with redirect_opt_num(), but bash doesn't do it. |
6536 | * "echo foo 2| cat" yields "foo 2". */ | 6542 | * "echo foo 2| cat" yields "foo 2". */ |
6537 | done_command(&ctx); | 6543 | done_command(&ctx); |
6544 | #if !BB_MMU | ||
6545 | o_reset_to_empty_unquoted(&ctx.as_string); | ||
6546 | #endif | ||
6538 | } | 6547 | } |
6539 | goto new_cmd; | 6548 | goto new_cmd; |
6540 | case '(': | 6549 | case '(': |
diff --git a/shell/hush_test/hush-misc/nommu2.right b/shell/hush_test/hush-misc/nommu2.right new file mode 100644 index 000000000..fb8ba8b5c --- /dev/null +++ b/shell/hush_test/hush-misc/nommu2.right | |||
@@ -0,0 +1,5 @@ | |||
1 | Ok | ||
2 | Ok | ||
3 | Ok | ||
4 | Ok | ||
5 | Done | ||
diff --git a/shell/hush_test/hush-misc/nommu2.tests b/shell/hush_test/hush-misc/nommu2.tests new file mode 100755 index 000000000..61ed5ce5b --- /dev/null +++ b/shell/hush_test/hush-misc/nommu2.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | echo Not shown | if true; then echo $(echo Ok); fi | ||
2 | echo Not shown | if true; then echo `echo Ok`; fi | ||
3 | echo Not shown | ( if true; then echo $(echo Ok); fi ) | ||
4 | echo Not shown | ( if true; then echo `echo Ok`; fi ) | ||
5 | echo Done | ||