[Bug 37478] New: cmd doesn't handle "else if" correctly in all cases
https://bugs.winehq.org/show_bug.cgi?id=37478 Bug ID: 37478 Summary: cmd doesn't handle "else if" correctly in all cases Product: Wine Version: 1.7.28 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs(a)winehq.org Reporter: jbb.rose(a)yahoo.com Distribution: --- cmd.exe doesn't seem to handle "else if" constructs correctly in all cases. This is making it difficult for me to run some complex build scripts under wine. Using this batch file: C:\Users\bjj\Documents>type try.bat @REM bjj test hack @echo off echo Args: "%1" "%2" "%3" "%4" if /I "%1" == "DEBUG" ( echo It is debug ) else if /I "%1" == "RELEASE" ( echo It is release ) else if /I "%1" == "TRY" ( echo It is try ) else ( echo it is neither: "%1" ) On Windows 7, all the branches seem to be handled correctly: C:\Users\bjj\Documents>try foo Args: "foo" "" "" "" it is neither: "foo" C:\Users\bjj\Documents>try DEBUG Args: "DEBUG" "" "" "" It is debug C:\Users\bjj\Documents>try RELEASE Args: "RELEASE" "" "" "" It is release C:\Users\bjj\Documents>try TRY Args: "TRY" "" "" "" It is try However, on wine 1.7.28 the "else" branch is sometimes executed when it shouldn't be: W:\>try foo Args: "foo" "" "" "" it is neither: "foo" W:\>try DEBUG Args: "DEBUG" "" "" "" It is debug it is neither: "DEBUG" W:\>try RELEASE Args: "RELEASE" "" "" "" It is release it is neither: "RELEASE" W:\>try TRY Args: "TRY" "" "" "" It is try Judging from this example, it appears that the "else" clause is only skipped if the final "if .. else if ..." clause is true. If one of the earlier clasues is true, the final "else" is unexpectedly executed. I haven't tried this batch file with earlier versions of wine. Thanks, Brian -- 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=37478 Mikhail Bystryantsev <ho-rr-or(a)mail.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ho-rr-or(a)mail.ru --- Comment #1 from Mikhail Bystryantsev <ho-rr-or(a)mail.ru> --- I have the same problem. Wine 1.7.33 if 1 == 1 ( echo FIRST ) else if 1 == 1 ( echo SECOND ) else ( echo THIRD ) Output: FIRST THIRD -- 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=37478 Thomas Faller <tfaller.dev(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tfaller.dev(a)gmail.com --- Comment #2 from Thomas Faller <tfaller.dev(a)gmail.com> --- I've submitted a patch for this issue: http://source.winehq.org/patches/data/112260 Both examples are fixed. -- 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=37478 --- Comment #3 from Thomas Faller <tfaller.dev(a)gmail.com> --- This issue was fixed by 3cda870469cc457766f677f51afe352285db437b Please can someone mark this bug as RESOLVED FIXED. Thank you. -- 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=37478 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |3cda870469cc457766f677f51af | |e352285db437b Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #4 from Bruno Jesus <00cpxxx(a)gmail.com> --- (In reply to Thomas Faller from comment #3)
This issue was fixed by 3cda870469cc457766f677f51afe352285db437b Please can someone mark this bug as RESOLVED FIXED. Thank you.
-- 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=37478 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.7.50. -- 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