Incorrect double quote handling in command line parameters on Win32 and Win64
## Summary <!-- Summarize the bug encountered concisely --> When using FPC programs compiled for Win32 or Win64 every double quote toggles the "quoted" status. This means that it is impossible to pass a double quote inside the parameters on the command line. ## System Information <!-- The more information are provided the easier it is to replicate the bug --> - **Operating system:** Windows - **Processor architecture:** x86, x86-64 - **Compiler version:** trunk - **Device:** Computer ## Steps to reproduce <!-- How one can reproduce the issue - this is very important! --> compile the example project and run with the following command line: testdoublequotes.exe """Bob was here""" ## Example Project <!-- If possible, please create an example project that exhibits the problematic behavior, and link to it here in the bug report. --> ``` program testdoublequotes; {$mode delphi} var i: integer; begin writeln('ParamCount:', ParamCount); for i := 1 to ParamCount do writeln('Param(', i, '):', ParamStr(i), ';'); end. ``` ## What is the current bug behavior? <!-- What actually happens --> Program outputs: ParamCount:1 Param(1):Bob was here; ## What is the expected (correct) behavior? <!-- What you should see instead --> ParamCount:1 Param(1):"Bob was here"; ## Possible fixes All other platforms, including WinCE and Win16, seem to handle escaping double quotes and using single quotes instead of double quotes. I will attach the patch I used to bring Win32 and Win64 parameter handling in line with WinCE and Win16. [syswin.inc.p1.diff](/uploads/09469446df322711551d5c1b6c9a6dc4/syswin.inc.p1.diff)
issue