Bug 3940 - Quotes get stripped from the commandline
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC Windows XP
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2009-01-17 04:54 EST by Anthony Jacques
Modified: 2009-09-15 02:13:05 EDT
1 user (show)

See Also:


Attachments
Patch which quotes any commandline arg that contains spaces (643 bytes, patch)
2009-01-17 04:58 EST, Anthony Jacques

Description Anthony Jacques 2009-01-17 04:54:20 EST
If a cvar value must contain spaces, and it is set via the commandline, you must quote the cvar value, so that Cmd_TokenizeString correctly parses it. However, the current code in main() rebuilds the commandline from tokenised arguments without regard to whether it was previously quoted. 

The user impact of this is that for example, +set fs_homepath "C:\bleh\New Folder" has the quotes stripped, and fs_homepath is set to "C:\bleh\New", and the commandline parser doesn't know what to do with the unexpected "folder" token.
Comment 1 Anthony Jacques 2009-01-17 04:58:42 EST
Created attachment 1956 [details]
Patch which quotes any commandline arg that contains spaces

This isn't thoroughly tested - I haven't tried what happens with other whitespace chars, although I doubt there are many times when you get tabs etc in the commandline.
Comment 2 Ryan C. Gordon 2009-09-15 02:13:05 EDT
Fixed in svn revision #1620, thanks!

--ryan.