diff options
author | Darkvater <Darkvater@openttd.org> | 2006-10-21 22:24:28 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-10-21 22:24:28 +0000 |
commit | 5f9fcc5b21fbdc830fb14e4dc1858c86e0d8b768 (patch) | |
tree | 0644dd728c8fc833af5f83aebc0ccb14eea7cac0 | |
parent | d45bd66836d78e9b089ca37826e39d1cee6cb78d (diff) | |
download | openttd-5f9fcc5b21fbdc830fb14e4dc1858c86e0d8b768.tar.xz |
(svn r6875) -Feature: Allow for " to be in console tokens. Escape them with \. eg \".
-rw-r--r-- | console.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1091,6 +1091,12 @@ void IConsoleCmdExec(const char *cmdstr) case '"': /* Tokens enclosed in "" are one token */ longtoken = !longtoken; break; + case '\\': /* Escape character for "" */ + if (cmdptr[1] == '"' && tstream_i + 1 < lengthof(tokenstream)) { + tokenstream[tstream_i++] = *++cmdptr; + break; + } + /* fallthrough */ default: /* Normal character */ tokenstream[tstream_i++] = *cmdptr; |