From f11dae94a3494b2f0afa73a2ad45c31daafd7997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Sun, 20 Dec 2015 18:44:28 +0200 Subject: [PATCH] Fixed|libcore|Info: Correct handling of value-terminating semicolons An optional semicolon may follow a key-value assignment when using the single-token `=` syntax. --- doomsday/sdk/libcore/src/data/info.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doomsday/sdk/libcore/src/data/info.cpp b/doomsday/sdk/libcore/src/data/info.cpp index 52c09031c7..52459b9360 100644 --- a/doomsday/sdk/libcore/src/data/info.cpp +++ b/doomsday/sdk/libcore/src/data/info.cpp @@ -30,7 +30,7 @@ namespace de { static QString const WHITESPACE = " \t\r\n"; static QString const WHITESPACE_OR_COMMENT = " \t\r\n#"; -static QString const TOKEN_BREAKING_CHARS = "#:=$(){}<>,\"" + WHITESPACE; +static QString const TOKEN_BREAKING_CHARS = "#:=$(){}<>,;\"" + WHITESPACE; static QString const INCLUDE_TOKEN = "@include"; static QString const SCRIPT_TOKEN = "script"; @@ -323,6 +323,8 @@ DENG2_PIMPL(Info) * first token of the value. Values come in different flavours: * - single token * - string literal (can be split) + * + * An optional semicolon may follow a value. */ InfoValue parseValue() { @@ -347,8 +349,12 @@ DENG2_PIMPL(Info) else { // Then it must be a single token. - value = peekToken(); - nextToken(); + if(peekToken() != ";") + { + value = peekToken(); + nextToken(); + if(peekToken() == ";") nextToken(); // Ignore the semicolon. + } } return value; }