https://bugs.winehq.org/show_bug.cgi?id=40483
Ziyue Yang yzylivezh@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yzylivezh@hotmail.com
--- Comment #1 from Ziyue Yang yzylivezh@hotmail.com --- It seems that once the '&' character is hit, the program take the whole substring before '&' as a new command.
As a result the "if foo==bar echo haha1& echo haha2" command is parsed as (if foo==bar echo haha1) & (echo haha2).
The problem is that the precedence of "if" is higher, and the test command should be parsed as
if foo==bar (echo haha1& echo haha2)
The whole command cannot be put into WCMD_if function directly for the "echo haha1& echo haha2" part would be parsed as a single command. However the origin command should be parsed as the following group of commands:
if foo==bar echo haha1 echo haha2
On the other hand, since WCMD_ReadAndParseLine doesn't deal with "if" parsing right now, it's impossible to parse the command correctly in this function without changing it a lot...
I'm thinking of detecting "if" condition in WCMD_ReadAndParseLine using the "inIf" flag.