Skip to content
Snippets Groups Projects
Forked from wine / wine
Source project has a limited visibility.
  • Jason Edmeades's avatar
    58d21b33
    cmd: Handle single line 'if' as nested if or with redirects. · 58d21b33
    Jason Edmeades authored and Alexandre Julliard's avatar Alexandre Julliard committed
    
    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>
    58d21b33
    History
    cmd: Handle single line 'if' as nested if or with redirects.
    Jason Edmeades authored and Alexandre Julliard's avatar Alexandre Julliard committed
    
    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>