Skip to content
Snippets Groups Projects
Commit 58d21b33 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard
Browse files

cmd: Handle single line 'if' as nested if or with redirects.


A single line if statement causes problems when it has redirects
and/or continuation type operators (|, &&, || etc) because it is
expected that if there is more than one command in the 'if', then it
will use brackets. This patch changes the 'if' parsing to emulate
brackets at a continuation character. In addition, 'for' and 'if'
statements do not have their output redirected immediately, instead it
is redirected on the individual commands being executed not the
statement itself. We were opening the redirect once for the 'if' and
once for the processing of the statement inside the if.

Signed-off-by: default avatarJason Edmeades <us@edmeades.me.uk>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent 5c444c4e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment