https://bugs.winehq.org/show_bug.cgi?id=47071
Bug ID: 47071 Summary: Nest or mixed "FOR" and "IF" command sometimes get different result in Wine and Windows. Product: Wine Version: 3.0 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: mzidbh@hotmail.com Distribution: ---
Created attachment 64257 --> https://bugs.winehq.org/attachment.cgi?id=64257 batch files and snapshots of execution result
The Wine's command interpreter seems to ...
1. could not pair "IF" and "ELSE" correctly. ( Case 1 4 )
2. would ignore scripts after inner "ELSE". ( Case 2 3 )
Case 1 ======================================== @ECHO OFF ECHO FOR in IF 01 :
IF 1 EQU 1 ( FOR %%A IN (1,1) DO ( ECHO A=%%A ) ) ELSE ( ECHO This line should NOT be executed. ) ECHO This line should be executed.
EXIT /B ---------------------------------------- Result in WINE 3.0 ---------------------------------------- FOR in IF 01 : A=1 A=1 Can't recognize 'ELSE ' as an internal or external command, or batch script. This line should NOT be executed. This line should be executed. ---------------------------------------- Result in Windows 7 ---------------------------------------- FOR in IF 01 : A=1 A=1 This line should be executed. ========================================
Case 2 ======================================== @ECHO OFF ECHO IF in FOR 01 :
FOR %%A IN (1,1) DO ( IF 1 EQU 1 ( ECHO This line should be executed. [No.1] ) ELSE ( ECHO This line should NOT be executed. ) ECHO This line should be executed. [No.2] )
EXIT /B ---------------------------------------- Result in WINE 3.0 ---------------------------------------- IF in FOR 01 : This line should be executed. [No.1] This line should be executed. [No.1] ---------------------------------------- Result in Windows 7 ---------------------------------------- IF in FOR 01 : This line should be executed. [No.1] This line should be executed. [No.2] This line should be executed. [No.1] This line should be executed. [No.2] ========================================
Case 3 ======================================== @ECHO OFF ECHO IF in IF 01 :
IF 1 EQU 1 ( IF 1 EQU 1 ( ECHO This line should be executed. [No.1] ) ELSE ( ECHO This line should NOT be executed. [No.1] ) ECHO This line should be executed. [No.2] ) ELSE ( ECHO This line should NOT be executed. [No.2] )
EXIT /B ---------------------------------------- Result in WINE 3.0 ---------------------------------------- IF in IF 01 : This line should be executed. [No.1] ---------------------------------------- Result in Windows 7 ---------------------------------------- IF in IF 01 : This line should be executed. [No.1] This line should be executed. [No.2] ========================================
Case 4 ======================================== @ECHO OFF ECHO IF in IF 04 :
IF 4 EQU 4 ( IF 4 EQU 5 CALL :Label1 ECHO This line should be executed. [No.1] ) ELSE ( ECHO This line should NOT be executed. [No.2] ) GOTO :Label2
:Label1 ECHO This line should NOT be executed. [No.1] GOTO :EOF
:Label2 EXIT /B ---------------------------------------- Result in WINE 3.0 ---------------------------------------- IF in IF 04 : This line should NOT be executed. [No.2] ---------------------------------------- Result in Windows 7 ---------------------------------------- IF in IF 04 : This line should be executed. [No.1] ========================================
https://bugs.winehq.org/show_bug.cgi?id=47071
pattietreutel katyaberezyaka@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |katyaberezyaka@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=47071
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #1 from Vijay Kamuju infyquest@gmail.com --- Tested with wine 4.0 Only this below one fails, all others pass.
Case 1 ======================================== @ECHO OFF ECHO FOR in IF 01 :
IF 1 EQU 1 ( FOR %%A IN (1,1) DO ( ECHO A=%%A ) ) ELSE ( ECHO This line should NOT be executed. ) ECHO This line should be executed.
EXIT /B
https://bugs.winehq.org/show_bug.cgi?id=47071
--- Comment #2 from mzidbh@hotmail.com --- (In reply to Vijay Kamuju from comment #1) Thanks for your reply. Is the 3.0 version still under maintaining ?
https://bugs.winehq.org/show_bug.cgi?id=47071
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |6c39db0ca01a93003d2fbf2581f | |c2c3fcb3266c8 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #3 from Vijay Kamuju infyquest@gmail.com --- Fixed by cmd rewrite - https://source.winehq.org/git/wine.git/commit/6c39db0ca01a93003d2fbf2581fc2c...
https://bugs.winehq.org/show_bug.cgi?id=47071
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.12.