hush: two NOMMU fixes for bugs 877 and 883
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
f2c8aa6676
commit
b70cef71eb
15
shell/hush.c
15
shell/hush.c
@ -4406,9 +4406,15 @@ static void debug_print_tree(struct pipe *pi, int lvl)
|
|||||||
lvl*2, "", prn,
|
lvl*2, "", prn,
|
||||||
command->assignment_cnt);
|
command->assignment_cnt);
|
||||||
if (command->group) {
|
if (command->group) {
|
||||||
fprintf(stderr, " group %s: (argv=%p)\n",
|
fprintf(stderr, " group %s: (argv=%p)%s%s\n",
|
||||||
CMDTYPE[command->cmd_type],
|
CMDTYPE[command->cmd_type],
|
||||||
argv);
|
argv
|
||||||
|
#if !BB_MMU
|
||||||
|
, " group_as_string:", command->group_as_string
|
||||||
|
#else
|
||||||
|
, "", ""
|
||||||
|
#endif
|
||||||
|
);
|
||||||
debug_print_tree(command->group, lvl+1);
|
debug_print_tree(command->group, lvl+1);
|
||||||
prn++;
|
prn++;
|
||||||
continue;
|
continue;
|
||||||
@ -5986,7 +5992,7 @@ static int handle_dollar(o_string *as_string,
|
|||||||
# if !BB_MMU
|
# if !BB_MMU
|
||||||
if (as_string) {
|
if (as_string) {
|
||||||
o_addstr(as_string, dest->data + pos);
|
o_addstr(as_string, dest->data + pos);
|
||||||
o_addchr(as_string, '`');
|
o_addchr(as_string, ')');
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
||||||
@ -6535,6 +6541,9 @@ static struct pipe *parse_stream(char **pstring,
|
|||||||
* with redirect_opt_num(), but bash doesn't do it.
|
* with redirect_opt_num(), but bash doesn't do it.
|
||||||
* "echo foo 2| cat" yields "foo 2". */
|
* "echo foo 2| cat" yields "foo 2". */
|
||||||
done_command(&ctx);
|
done_command(&ctx);
|
||||||
|
#if !BB_MMU
|
||||||
|
o_reset_to_empty_unquoted(&ctx.as_string);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
goto new_cmd;
|
goto new_cmd;
|
||||||
case '(':
|
case '(':
|
||||||
|
5
shell/hush_test/hush-misc/nommu2.right
Normal file
5
shell/hush_test/hush-misc/nommu2.right
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Ok
|
||||||
|
Ok
|
||||||
|
Ok
|
||||||
|
Ok
|
||||||
|
Done
|
5
shell/hush_test/hush-misc/nommu2.tests
Executable file
5
shell/hush_test/hush-misc/nommu2.tests
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
echo Not shown | if true; then echo $(echo Ok); fi
|
||||||
|
echo Not shown | if true; then echo `echo Ok`; fi
|
||||||
|
echo Not shown | ( if true; then echo $(echo Ok); fi )
|
||||||
|
echo Not shown | ( if true; then echo `echo Ok`; fi )
|
||||||
|
echo Done
|
Loading…
x
Reference in New Issue
Block a user