[Bug 40483] New: cmd execute "if foo==bar echo haha1& echo haha2" in a wrong way
https://bugs.winehq.org/show_bug.cgi?id=40483 Bug ID: 40483 Summary: cmd execute "if foo==bar echo haha1& echo haha2" in a wrong way Product: Wine Version: 1.9.8 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs(a)winehq.org Reporter: fracting(a)gmail.com Distribution: --- Step to reproduce" Run the below command line in cmd console: if foo==bar echo haha1& echo haha2 Expect result: On windows, the command prints nothing Actual result: On Wine, the command prints "haha2" This makes latest MSYS2 fails. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 Ziyue Yang <yzylivezh(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yzylivezh(a)hotmail.com --- Comment #1 from Ziyue Yang <yzylivezh(a)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. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 Carlos Rafael Ramirez <crramirez(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |crramirez(a)gmail.com --- Comment #2 from Carlos Rafael Ramirez <crramirez(a)gmail.com> --- Duplicate of https://bugs.winehq.org/show_bug.cgi?id=33636 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dimesio(a)earthlink.net -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 --- Comment #3 from winetest(a)luukku.com --- (In reply to Carlos Rafael Ramirez from comment #2)
Duplicate of https://bugs.winehq.org/show_bug.cgi?id=33636
Wasnt that other bug fixed with the commit(s)? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #4 from Bruno Jesus <00cpxxx(a)gmail.com> --- (In reply to Carlos Rafael Ramirez from comment #2)
Duplicate of https://bugs.winehq.org/show_bug.cgi?id=33636
Indeed, thanks. *** This bug has been marked as a duplicate of bug 33636 *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=40483 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Bruno Jesus <00cpxxx(a)gmail.com> --- Closing duplicate bugs. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org