From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/cmd/tests/test_builtins.cmd.exp | 30 ++++++++++++------------ programs/cmd/wcmdmain.c | 11 +++++++++ 2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 55768455b6d..1909bb9a8c1 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -438,7 +438,7 @@ h1 else echo h2 --- i1 else echo i2 i3 -@todo_wine@j2@space@ +j2@space@ --- k1 k2 @@ -465,20 +465,20 @@ p2 q2 q3 ------------- Testing for variables expansion in pipes -@todo_wine@a@space@@space@ -@todo_wine@b@space@@space@ +a@space@@space@ +b@space@@space@
--- -@todo_wine@a-c@space@@space@ -@todo_wine@a-d@space@@space@ -@todo_wine@b-c@space@@space@ -@todo_wine@b-d@space@@space@ +a-c@space@@space@ +a-d@space@@space@ +b-c@space@@space@ +b-d@space@@space@
--- -@todo_wine@a same a@space@ -@todo_wine@a diff b@space@ -@todo_wine@b diff a@space@ -@todo_wine@b same b@space@ +a same a@space@ +a diff b@space@ +b diff a@space@ +b same b@space@
--- foo @@ -490,16 +490,16 @@ yy!WINE_VAR!yy@space@ yyfooyy yyfooyy@space@
-@todo_wine@yy!WINE_VAR!yy@space@ +yy!WINE_VAR!yy@space@
-@todo_wine@yy!WINE_VAR!yy@space@ +yy!WINE_VAR!yy@space@
--- bar1bar@space@
-@todo_wine@bar2bar@space@ -@todo_wine@ +bar2bar@space@ + ------------- Testing internal commands return codes --- success/failure for basics SUCCESS 0 diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 8c9002acc1b..365dd071768 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -3538,6 +3538,14 @@ static BOOL rebuild_append_command(struct command_rebuild *rb, const CMD_NODE *n case CMD_FOR: ret = rebuild_command_for(rb, node, rbflags); break; + case CMD_BLOCK: + { + struct rebuild_flags new_rbflags = {.precedence = 0, .depth = rbflags.depth = 1}; + ret = rebuild_append(rb, L"( ") && + rebuild_append_command(rb, node->block, new_rbflags) && + rebuild_append(rb, L" ) "); + } + break; default: FIXME("Shouldn't happen\n"); ret = FALSE; @@ -4521,6 +4529,8 @@ static BOOL can_run_new_pipe(CMD_NODE *node) (!node->else_block || can_run_new_pipe(node->else_block)); case CMD_FOR: return can_run_new_pipe(node->do_block); + case CMD_BLOCK: + return can_run_new_pipe(node->block); default: return FALSE; } @@ -4572,6 +4582,7 @@ static RETURN_CODE spawn_pipe_sub_command(CMD_NODE *node, HANDLE *child) case CMD_ONSUCCESS: case CMD_IF: case CMD_FOR: + case CMD_BLOCK: if (!rebuild_append_command(&rb, node, rbflags)) return ERROR_INVALID_FUNCTION; break;