changeset 4905:91982f32fd08 draft

(svn r6875) -Feature: Allow for " to be in console tokens. Escape them with \. eg \".
author Darkvater <Darkvater@openttd.org>
date Sat, 21 Oct 2006 22:24:28 +0000
parents 2fad7902b25f
children 07cfce2e8fd1
files console.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/console.c
+++ b/console.c
@@ -1091,6 +1091,12 @@
 		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;