[Bug 25901] New: Incorrect command line parsing in cmd
http://bugs.winehq.org/show_bug.cgi?id=25901 Summary: Incorrect command line parsing in cmd Product: Wine Version: 1.3.12 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd AssignedTo: wine-bugs(a)winehq.org ReportedBy: atohom(a)gmail.com #include <stdio.h> #include <windows.h> int main(int nargs, char *args[]) { if(nargs>1) { char *cl=GetCommandLine(); printf("%s\n", cl); } else { STARTUPINFO si={sizeof(STARTUPINFO)}; PROCESS_INFORMATION pi; CreateProcess(NULL, "cmd /C \"\"test.exe\" \"1 2 3\"\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CreateProcess(NULL, "cmd /C \"\"test.exe\" \"\"1 2 3\"\"\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CreateProcess(NULL, "cmd /C test.exe \" 1", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CreateProcess(NULL, "cmd /C test.exe \"\\\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); CreateProcess(NULL, "cmd /C test.exe \"/\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); WaitForSingleObject(pi.hProcess, INFINITE); } return 0; } On Windows this test program prints: "test.exe" "1 2 3" "test.exe" ""1 2 3"" test.exe " 1 test.exe "\" test.exe "/" but in wine you get: test.exe 1 2 3 test.exe 1 2 3 test.exe " 1" test.exe \" test.exe / quote from cmd help on how it is supposed to work: If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters: 1. If all of the following conditions are met, then quote characters on the command line are preserved: - no /S switch - exactly two quote characters - no special characters between the two quote characters, where special is one of: &<>()@^| - there are one or more whitespace characters between the two quote characters - the string between the two quote characters is the name of an executable file. 2. Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character. -- 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=25901 Dan Kegel <dank(a)kegel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dank(a)kegel.com --- Comment #1 from Dan Kegel <dank(a)kegel.com> 2011-01-27 11:48:22 CST --- Thanks for the test case. Where does this problem affect you in real life? Do you have an app that this breaks? -- 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=25901 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, 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=25901 --- Comment #2 from atohom(a)gmail.com 2011-01-27 13:46:57 CST --- (In reply to comment #1)
Thanks for the test case. Where does this problem affect you in real life? Do you have an app that this breaks?
I found this problem when working with FAR Manager (http://farmanager.com/), it uses cmd to launch another programs and that programs often get incorrect command line. -- 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=25901 Roumen Petrov <bugtrack(a)roumenpetrov.info> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugtrack(a)roumenpetrov.info --- Comment #3 from Roumen Petrov <bugtrack(a)roumenpetrov.info> 2011-06-15 16:25:17 CDT --- I think this is reason some python 3+ tests to fail on wine up to 1.3.16. -- 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=25901 Vijay Kamuju <infyquest(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest(a)gmail.com --- Comment #4 from Vijay Kamuju <infyquest(a)gmail.com> 2011-09-09 15:38:55 CDT --- please test with wine 1.3.28 -- 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=25901 --- Comment #5 from Roumen Petrov <bugtrack(a)roumenpetrov.info> 2011-09-11 12:36:35 CDT --- not fixed in 1.3.28 -- 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=25901 Frédéric Delanoy <frederic.delanoy(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |frederic.delanoy(a)gmail.com Ever Confirmed|0 |1 --- Comment #6 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-09-13 13:40:26 CDT --- Confirmed in 1.3.28 -- 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=25901 --- Comment #7 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-11-09 19:44:54 CST --- Martin Wilck gave a shot at fixing this, but his patches weren't committed (and it seems he has lost interest/motivation in getting those in). See http://www.winehq.org/pipermail/wine-patches/2011-September/107362.html http://www.winehq.org/pipermail/wine-patches/2011-September/107364.html http://www.winehq.org/pipermail/wine-patches/2011-September/107368.html http://www.winehq.org/pipermail/wine-patches/2011-September/107371.html http://www.winehq.org/pipermail/wine-patches/2011-September/107374.html http://www.winehq.org/pipermail/wine-patches/2011-September/107363.html -- 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=25901 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |us(a)edmeades.me.uk AssignedTo|wine-bugs(a)winehq.org |us(a)edmeades.me.uk -- 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=25901 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f252e9dfc85303d645ec545f238 | |fd8ee11ff2497 Status|NEW |RESOLVED Resolution| |FIXED --- Comment #8 from Jason Edmeades <us(a)edmeades.me.uk> 2012-10-03 16:12:02 CDT --- Fixed in todays commits: jason(a)jason-VirtualBox:/media/sf_wine$ wine test.exe "test.exe" "1 2 3" "test.exe" ""1 2 3"" test.exe " 1 test.exe "\" test.exe "/" -- 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=25901 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #9 from Alexandre Julliard <julliard(a)winehq.org> 2012-10-12 13:35:23 CDT --- Closing bugs fixed in 1.5.15. -- 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