[Scummvm-git-logs] scummvm master -> 4e71453101790adb290278bf62f7609c92f27e21
sev-
sev at scummvm.org
Sun Jun 14 22:06:28 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4e71453101 DIRECTOR: LINGO: Properly process strings in prev/nexttok
Commit: 4e71453101790adb290278bf62f7609c92f27e21
https://github.com/scummvm/scummvm/commit/4e71453101790adb290278bf62f7609c92f27e21
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-06-15T00:06:15+02:00
Commit Message:
DIRECTOR: LINGO: Properly process strings in prev/nexttok
Changed paths:
engines/director/lingo/lingo-preprocessor.cpp
diff --git a/engines/director/lingo/lingo-preprocessor.cpp b/engines/director/lingo/lingo-preprocessor.cpp
index 94f1d64d64..cbe62fa328 100644
--- a/engines/director/lingo/lingo-preprocessor.cpp
+++ b/engines/director/lingo/lingo-preprocessor.cpp
@@ -41,7 +41,15 @@ static Common::String nexttok(const char *s, const char **newP = nullptr) {
while (*s && (*s == ' ' || *s == '\t' || *s == '\xC2')) // If we see a whitespace
s++;
- if (Common::isAlnum(*s)) {
+ if (*s == '"') { // If it is a string then scan till end quote
+ res += *s++;
+
+ while (*s && *s != '"')
+ res += *s++;
+
+ if (*s == '"')
+ res += *s++;
+ } else if (Common::isAlnum(*s)) {
// Now copy everything till whitespace
while (*s && (Common::isAlnum(*s) || *s == '.'))
res += *s++;
@@ -67,8 +75,15 @@ static Common::String prevtok(const char *s, const char *lineStart, const char *
break;
}
- // Now copy everything till whitespace
- if (Common::isAlnum(*s)) {
+ if (*s == '"') { // If it is a string then scan till end quote
+ res += *s--;
+
+ while (s >= lineStart && *s != '"')
+ res = *s-- + res;
+
+ if (*s == '"')
+ res = *s-- + res;
+ } else if (Common::isAlnum(*s)) { // Now copy everything till whitespace
// Now copy everything till whitespace
while (s >= lineStart && (Common::isAlnum(*s) || *s == '.'))
res = *s-- + res;
More information about the Scummvm-git-logs
mailing list