http://bugs.winehq.org/show_bug.cgi?id=18057
Summary: mishandled has_space==1 && opt_s==0 in programs/wcmdmain.c for built in commands Product: Wine Version: 1.1.19 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: programs AssignedTo: wine-bugs@winehq.org ReportedBy: swelef@post.sk
When using ActivePerl to execute Perl statements such as my $p=`set PATH`; ActivePerl will pass it as a quoted argument to CreateProcessW: CreateProcessW app L"cmd.exe" cmdline L"cmd.exe /x/d/c "set PATH"" wcmdmain.c:wmain will get the following arguments: 0 => L"cmd.exe" 1 => L"/x/d/c" 2 => L"set PATH" and determine that has_space==1 && opt_s==0 thus creating cmd = L""set PATH"" This command is later passed to WCMD_execute where there's no match with the "inbuilt[]" commands (because of the leading double-quote) and it's in turn passed to WCMD_run_program. That function tries to do its best but in the if ((opt_c || opt_k) && !opt_s && !status && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='"') branch (wcmdmain.c, lines #1158-1162 in wine 1.1.19) it strips the quotes and calls _itself_ thus missing the check for "inbuilt[]" commands. What's required here is to call back to WCMD_execute but unfortunately some of the WCMD_execute's arguments are not available at this point.
PS: I'm trying to use S60_5th_Edition_SDK_v1.0 on debian lenny and the first point of failure was the Perl statement open PIPE, "set EPOCROOT |"; I have made experiments with wine 1.0.1 and 1.1.19 and with ActivePerl 5.10.0.1004 and StrawberryPerl 5.10.0.4 with the same results. However, Wine 1.1.19 with ActivePerl and `set PATH` is the only test case I have investigated in depth.
http://bugs.winehq.org/show_bug.cgi?id=18057
Vladimir Marko swelef@post.sk changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|other |All Platform|Other |All Summary|mishandled has_space==1 && |cmd.exe: mishandled quoted |opt_s==0 in |built-in commands with |programs/wcmdmain.c for |parameters |built in commands |(programs/wcmdmain.c: | |has_space==1 && opt_s==0)
http://bugs.winehq.org/show_bug.cgi?id=18057
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|All |other Platform|All |Other
--- Comment #1 from Vitaliy Margolen vitaliy@kievinfo.com 2009-04-20 21:26:06 --- Select your hardware and OS. DO NOT use "All".
http://bugs.winehq.org/show_bug.cgi?id=18057
Vladimir Marko swelef@post.sk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |swelef@post.sk OS/Version|other |Linux Platform|Other |PC Summary|cmd.exe: mishandled quoted |cmd.exe: mishandled quoted |built-in commands with |built-in commands with |parameters |parameters |(programs/wcmdmain.c: |(programs/cmd/wcmdmain.c: |has_space==1 && opt_s==0) |has_space==1 && opt_s==0)
--- Comment #2 from Vladimir Marko swelef@post.sk 2009-04-21 17:57:51 --- OK, I've selected _my_ hardware and OS despite being sure that the bug will be present on all HW/OS combinations where wine runs (the source code doesn't lie).
The simple test case for this bug is wine cmd /c "set PATH" and I have checked on Windows XP that the command cmd /c "set PATH" indeed returns the Path environment variable (and PATHEXT).
http://bugs.winehq.org/show_bug.cgi?id=18057
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #3 from Austin English austinenglish@gmail.com 2009-10-29 20:19:44 --- Still present: Z:\home\austin\gits\winezeug>set path PATH=C:\windows\system32;C:\windows
Z:\home\austin\gits\winezeug>"set PATH" File not found
http://bugs.winehq.org/show_bug.cgi?id=18057
Peter Dons Tychsen donpedro@tdcadsl.dk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |donpedro@tdcadsl.dk
--- Comment #4 from Peter Dons Tychsen donpedro@tdcadsl.dk 2009-12-26 15:23:15 --- Austin, i ma not sure your test-case is correct. The test you are doing also fails on my XP. I think the only thing that should work is:
cmd /c "set PATH"
This could indicate that the problem is in the handling of "/c" or maybe in CreateProcess() itself (might be handling hyphens differently).
http://bugs.winehq.org/show_bug.cgi?id=18057
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|programs |cmd
http://bugs.winehq.org/show_bug.cgi?id=18057
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |us@edmeades.me.uk
--- Comment #5 from Jason Edmeades us@edmeades.me.uk 2010-01-06 18:26:37 --- Adding myself to the cmd bugs
http://bugs.winehq.org/show_bug.cgi?id=18057
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|wine-bugs@winehq.org |us@edmeades.me.uk
--- Comment #6 from Jason Edmeades us@edmeades.me.uk 2010-09-06 14:28:16 CDT --- Patch submitted for this bug in tghe patchset starting http://www.winehq.org/pipermail/wine-patches/2010-September/092915.html
Patch set failed on WinNT4 so reworking slightly, but fixes for this defect are included in it.
http://bugs.winehq.org/show_bug.cgi?id=18057
Frédéric Delanoy frederic.delanoy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic.delanoy@gmail.com
--- Comment #7 from Frédéric Delanoy frederic.delanoy@gmail.com 2011-07-14 10:35:16 CDT --- Does this bug still occur in current Wine (1.3.24)?
http://bugs.winehq.org/show_bug.cgi?id=18057
--- Comment #8 from Vladimir Marko swelef@post.sk 2011-10-06 15:08:09 CDT --- (In reply to comment #7)
Does this bug still occur in current Wine (1.3.24)?
Still occurs in 1.3.29.
http://bugs.winehq.org/show_bug.cgi?id=18057
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|us@edmeades.me.uk |wine-bugs@winehq.org
http://bugs.winehq.org/show_bug.cgi?id=18057
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f252e9dfc85303d645ec545f238 | |fd8ee11ff2497 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #9 from Jason Edmeades us@edmeades.me.uk 2012-10-03 16:15:58 CDT --- Should have been fixed in todays commits
jason@jason-VirtualBox:/media/sf_wine$ wine cmd /c "set PATH" PATH=C:\windows\system32;C:\windows;C:\windows\system32\wbem PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
http://bugs.winehq.org/show_bug.cgi?id=18057
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2012-10-12 13:36:34 CDT --- Closing bugs fixed in 1.5.15.