[Scummvm-git-logs] scummvm master -> a7efc8afd8f4831d00eec82bfdd8b299f56f6d52

bluegr bluegr at gmail.com
Tue Jun 18 20:20:37 CEST 2019


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:
a7efc8afd8 WINTERMUTE: Fix Split() method of ext_string


Commit: a7efc8afd8f4831d00eec82bfdd8b299f56f6d52
    https://github.com/scummvm/scummvm/commit/a7efc8afd8f4831d00eec82bfdd8b299f56f6d52
Author: lolbot-iichan (lolbot_iichan at mail.ru)
Date: 2019-06-18T21:20:33+03:00

Commit Message:
WINTERMUTE: Fix Split() method of ext_string

It's hard to believe, but this fixes bug "#10432" WME Carol Reed
Mysteries hint system not working.

Carol Reed hint system happen to heavily use line.Split(";") results,
which were wrong by 1 byte (delimeter was appended to result while it
shouldn't be).

I started with decompiling Carol Reed source code, reproducing issue
with a stand-alone test project (which worked with WME and showed [null]
with ScummVM). then minimized it to a minimal testcase:

var line = new String("New Goal;Visit Christina at the Art
Museum;1;0;S;;");
var ar = line.Split(";");
if((ar[0] == "New Goal")) { var g = ar[1]; }

Changed paths:
    engines/wintermute/base/scriptables/script_ext_string.cpp


diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index bc0c658..3b6fbf2 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -303,7 +303,7 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
 			uint32 ch = (i == str.size()) ? '\0' : str[i];
 			if (ch =='\0' || delims.contains(ch)) {
 				if (i != start) {
-					parts.push_back(WideString(str.c_str() + start, i - start + 1));
+					parts.push_back(WideString(str.c_str() + start, i - start));
 				} else {
 					parts.push_back(WideString());
 				}





More information about the Scummvm-git-logs mailing list