r7467 - trunk/darkplaces

divverent at icculus.org divverent at icculus.org
Sat Jul 7 18:19:23 EDT 2007


Author: divverent
Date: 2007-07-07 18:19:22 -0400 (Sat, 07 Jul 2007)
New Revision: 7467

Modified:
   trunk/darkplaces/cmd.c
   trunk/darkplaces/common.c
Log is attached.
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.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20070707.221922.diff
URL: <http://icculus.org/pipermail/twilight-commits/attachments/20070707/204265d2/attachment.diff>


More information about the twilight-commits mailing list