[Bug 27741] New: Imbricated for loops parameters not expanded correctly
http://bugs.winehq.org/show_bug.cgi?id=27741 Summary: Imbricated for loops parameters not expanded correctly Product: Wine Version: 1.3.24 Platform: All OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: cmd AssignedTo: wine-bugs(a)winehq.org ReportedBy: frederic.delanoy(a)gmail.com Created an attachment (id=35491) --> (http://bugs.winehq.org/attachment.cgi?id=35491) +cmd log Say your test_builtins.cmd looks like @echo off for %%i in (A) do ( for %%j in (A) do ( call :myFun %%i %%j )) goto :end :myFun echo %1 %2 goto :eof :end and the test_builtins.cmd.exp contains "A A" as only line. Then a test run gives: batch.c:205: Test failed: unexpected char 0x69 position 0 in line 1 (got 'i A', wanted 'A A') -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Frédéric Delanoy <frederic.delanoy(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 --- Comment #1 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-07-10 02:53:11 CDT --- @echo off for %%i in (X) do ( for %%j in (Y) do ( call :myFun %%i %%j )) gives "%i Y" instead of "X Y" -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 --- Comment #2 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-07-10 02:55:07 CDT --- (In reply to comment #1)
@echo off for %%i in (X) do ( for %%j in (Y) do ( call :myFun %%i %%j ))
gives "%i Y" instead of "X Y"
Hmm... bad copy paste earlier, it should be @echo off for %%i in (X) do ( for %%j in (Y) do ( echo %%i %%j )) gives "%i Y" instead of "X Y" -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 --- Comment #3 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-07-12 14:54:14 CDT --- Tests integrated: http://source.winehq.org/git/wine.git/commitdiff/63a6a80d40a107f734b8a0c8617... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other --- Comment #4 from Austin English <austinenglish(a)gmail.com> 2012-02-23 15:27:04 CST --- Removing deprecated 'All' Platform. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |us(a)edmeades.me.uk --- Comment #5 from Jason Edmeades <us(a)edmeades.me.uk> 2012-11-04 18:23:31 CST --- 99% of this will be fixed when I get my fix for 21047 in (all todos were I think) The problem is I have one case I cannot see how to resolve at present, and its an extreme corner case which I think is best left waiting for a real life usecase (other than a todo in tests) is for %a in.... for %a in .... When reading the 2nd line, wine finds the %a and helpfully expands it, meaning the for loop logic doesnt find a variable anymore. No idea how windows does this, other than not expanding anything after a 'for'... It does expand the rest on the line, e.g. the %%a in the brackets is correctly expanded: for %%a in ("foobar") do ( echo %%a for %%a in (%%a) do ( echo %%a ) ) Something like the following (yes, I am warped at times) doesnt work in windows: for /f "delims=:" %%a in ("in (jason) do echo %%b") do ( echo %%a for %%b %%a ) So I think windows see's a line starting with for, and does special processing / no expanding until it gets beyond the first '('. More testing/experimenting, but wanted to document findings so far. I have very strong suspicions that for (at least, possibly 'if' too) has special, individual parsing which might explain why this happens - for example you cannot 'call' a for loop, and whilst the following works for echo, it doesnt work for a 'for' loop... "for %a in (echo.hello) do %a" -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx(a)gmail.com --- Comment #6 from Bruno Jesus <00cpxxx(a)gmail.com> 2012-11-06 16:16:35 CST --- Patch commited: http://source.winehq.org/git/wine.git/commitdiff/ae4571fb796dc03d91a63d6c5c2... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Frédéric Delanoy <frederic.delanoy(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |ae4571fb796dc03d91a63d6c5c2 | |a80a08f587578 Status|NEW |RESOLVED Resolution| |FIXED --- Comment #7 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2012-11-06 16:20:16 CST --- Fixed by http://source.winehq.org/git/wine.git/commitdiff/ae4571fb796dc03d91a63d6c5c2... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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.
http://bugs.winehq.org/show_bug.cgi?id=27741 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #8 from Alexandre Julliard <julliard(a)winehq.org> 2012-11-09 13:00:37 CST --- Closing bugs fixed in 1.5.17. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email 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