]> git.xonotic.org Git - xonotic/darkplaces.git/commit
changed parsing/cvar expanding rules to allow better handling of cvars with evil...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Jul 2007 22:19:22 +0000 (22:19 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Jul 2007 22:19:22 +0000 (22:19 +0000)
commit2616da26cb879576841532c32923b1fe938f0de0
treedfa02ebc542f90af7081e28ab3ffb67faeef2101
parent619046da73eaa7d3730f9ec099008dc6be324d72
changed parsing/cvar expanding rules to allow better handling of cvars with evil characters in their value, and to allow for easy concatenation of cvar values:
- \\ inside quoted strings now becomes \ (which is honored by semicolon splitting too)
- only one round of expansion when processing an alias (expanding cvars and parameters at the same time); this is implemented by duplicating every resulting dollar sign when expanding an alias
- lines starting with alias are exempt from cvar expansion (to be compatible with older versions that rely on alias lines with double quoted arguments to not have cvar expansion, which got changed in a recent commit); this can be overridden by quoting the word "alias"
- add ${cvar} syntax so one can expand a cvar and immediately follow with some letters
- add ${$cvar} syntax to reintroduce indirection similar to what could previously be done because aliases were expanded in two rounds
- make $cvar expansion insert the cvar in a way that isn't harmful when inside double quotes (that is, backslash double quotes and backslashes); this then allows copying cvars using: set copy "$original"

A detailed description of the rules is in cmd.c, Cmd_PreprocessString in a big comment block.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7467 d7cf8633-e32d-0410-b094-e92efae38249
cmd.c
common.c