[Bug 46721] New: Two quotes together (in outer quotes) not parsed correctly in argv
https://bugs.winehq.org/show_bug.cgi?id=46721 Bug ID: 46721 Summary: Two quotes together (in outer quotes) not parsed correctly in argv Product: Wine Version: 4.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs(a)winehq.org Reporter: brendan(a)redmandi.com Distribution: --- Created attachment 63693 --> https://bugs.winehq.org/attachment.cgi?id=63693 kernel32: Allow double quote style escape in argv In Windows, two quotes together (within outer quotes) represents a single quote (with the first quote - of the inner quotes - acting as an escape character). Thus calling 'CreateProcessA' with four quotes as a parameter (i.e. '""""') will represent a single quote (i.e. '"'). In wine, this is currently being treated as two separate sets of quotes and thus results in a empty value. The attached patch fixes the problem. This can be tested with the following (just copy and paste): cat << END > test.c #include <windows.h> #include <stdio.h> int main(int argc, const char *argv[]) { PROCESS_INFORMATION processInfo; STARTUPINFO startupInfo; memset(&startupInfo, 0, sizeof startupInfo); startupInfo.cb = sizeof startupInfo; if (!CreateProcessA( NULL, "printArgs.exe \"\"\"\"", 0, 0, TRUE, 0, NULL, NULL, &startupInfo, &processInfo)) { DWORD dwLastError = GetLastError(); fprintf(stderr, "failed to execute printArgs.exe (%lu)\n", dwLastError); return 1; } return 0; } END cat << END > printArgs.c #include <stdio.h> int main(int argc, const char *argv[]) { for (int i = 0; i < argc; i++) printf("%s\n", argv[i]); return 0; } END x86_64-w64-mingw32-gcc test.c -o test.exe x86_64-w64-mingw32-gcc printArgs.c -o printArgs.exe wine64 test -- 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=46721 Brendan McGrath <brendan(a)redmandi.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |87917df887e00254a457a859c06 | |892307b4e2daf Status|UNCONFIRMED |RESOLVED --- Comment #1 from Brendan McGrath <brendan(a)redmandi.com> --- This is fixed with commit 87917df887e00254a457a859c06892307b4e2daf, which will be available in Wine v4.4. -- 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=46721 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 4.4. -- 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=46721 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.0.x -- 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=46721 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.x |--- --- Comment #3 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 4.0.x milestone from bug fixes included in 4.0.2. -- 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