- Added "\c" support to ParseCommandLine() when it parses quoted strings.
- Fixed: When changing your name from the menu, you got an extra " appended to your name if it ended with a backslash. - Added escape sequences for user info strings, so now they can contain embedded backslashes. - Fixed an array-out-of-bounds access when drawing the player setup menu with an invalid team number. SVN r598 (trunk)
This commit is contained in:
parent
089c2dab48
commit
8d5402cec2
5 changed files with 123 additions and 37 deletions
|
|
@ -718,8 +718,11 @@ void AddCommandString (char *cmd, int keynum)
|
|||
// to point to a buffer large enough to hold all the arguments. The
|
||||
// return value is the necessary size of this buffer.
|
||||
//
|
||||
// Special processing: Inside quoted strings, \" becomes just "
|
||||
// $<cvar> is replaced by the contents of <cvar>
|
||||
// Special processing:
|
||||
// Inside quoted strings, \" becomes just "
|
||||
// \\ becomes just \
|
||||
// \c becomes just TEXTCOLOR_ESCAPE
|
||||
// $<cvar> is replaced by the contents of <cvar>
|
||||
|
||||
static long ParseCommandLine (const char *args, int *argc, char **argv)
|
||||
{
|
||||
|
|
@ -759,6 +762,14 @@ static long ParseCommandLine (const char *args, int *argc, char **argv)
|
|||
{
|
||||
stuff = '\"', args++;
|
||||
}
|
||||
else if (stuff == '\\' && *args == '\\')
|
||||
{
|
||||
args++;
|
||||
}
|
||||
else if (stuff == '\\' && *args == 'c')
|
||||
{
|
||||
stuff = TEXTCOLOR_ESCAPE, args++;
|
||||
}
|
||||
else if (stuff == '\"')
|
||||
{
|
||||
stuff = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue