http://zandronum.com/tracker/view.php?id=973
The question is: how does the command line parsing work on Windows? How does it treat the quotation marks and is the current behavior proper? I've done some testing and here are the results:
- The following command line works correctly. The in-game sv_hostname variable is properly set to 'ExampleServer':
Code: Select all
zdoom.exe -iwad doom2.wad +sv_hostname "ExampleServer"
- This command line also works correctly. The in-game sv_hostname cvar is set to 'Example Server' as expected:
Code: Select all
zdoom.exe -iwad doom2.wad +sv_hostname "Example Server"
- Here begins weird behavior. In WinAPI the CommandLineToArgvW(GetCommandLineW()) function combo translates an argument like this one to 'Examp"le Server'. However, in ZDoom the in-game cvar gets cut off and says 'Examp':
Code: Select all
zdoom.exe -iwad doom2.wad +sv_hostname "Examp\"le Server"
- Now, this one works correctly. You insert a double backslash and a backslash followed by the quotation mark. I guess the game parses it to \" and this gets interpreted properly when being applied to the cvar. The in-game cvar now says 'Examp"le Server' as expected:
However ...
Code: Select all
zdoom.exe -iwad doom2.wad +sv_hostname "Examp\\\"le Server"
- ... when spacebar is removed then this messes up yet again. The result for the following command line is 'sv_hostname' being set to 'Examp\':
Code: Select all
zdoom.exe -iwad doom2.wad +sv_hostname "Examp\\\"leServer"
Note: The problem seems to be platform independent. I did some checks with Zandronum on Linux and it pretty much behaves the same way there.