From dc055b74c153ca68aa2406d0111a445a24cfe7ab Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 7 Nov 2016 09:54:46 +0100 Subject: [PATCH] - fixed the octal parser in strbin. Like its hex counterpart it needs to backtrack one character if it find the end of a sequence. - since ZScript already receives filtered strings, the 'T' converter for the properties should not do it again. --- src/cmdlib.cpp | 6 ++++++ src/scripting/zscript/zcc_compile.cpp | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cmdlib.cpp b/src/cmdlib.cpp index 3a3d2876d..5799a2342 100644 --- a/src/cmdlib.cpp +++ b/src/cmdlib.cpp @@ -632,7 +632,10 @@ int strbin (char *str) if (*p >= '0' && *p <= '7') c += *p-'0'; else + { + p--; break; + } p++; } *str++ = c; @@ -732,7 +735,10 @@ FString strbin1 (const char *start) if (*p >= '0' && *p <= '7') c += *p-'0'; else + { + p--; break; + } p++; } result << c; diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index f52976512..889cdb5fd 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -1676,13 +1676,10 @@ void ZCCCompiler::DispatchProperty(FPropertyInfo *prop, ZCC_PropertyStmt *proper case 'C': // this parser accepts colors only in string form. pref.i = 1; case 'S': + case 'T': // a filtered string (ZScript only parses filtered strings so there's nothing to do here.) conv.s = GetString(exp); break; - case 'T': // a filtered string - conv.s = strings[strings.Reserve(1)] = strbin1(GetString(exp)); - break; - case 'L': // Either a number or a list of strings if (!GetString(exp, true)) {