diff options
author | Kamil Zbróg | 2013-11-26 18:53:03 +0000 |
---|---|---|
committer | Kamil Zbróg | 2013-11-26 18:53:03 +0000 |
commit | 15bb1c61eda48f09253ccb8d2a42ccad59f3b00a (patch) | |
tree | c2f5ac2907225730c6f1cdaa000f549ef7951183 /engines/wintermute/base/scriptables | |
parent | 446c57d281e592653c9935c896d33334d23f0519 (diff) | |
parent | e1afc7d0d777dad4b7ca0a58f0bb0324b24f9584 (diff) | |
download | scummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.tar.gz scummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.tar.bz2 scummvm-rg350-15bb1c61eda48f09253ccb8d2a42ccad59f3b00a.zip |
Merge remote-tracking branch 'sync/master' into prince-malik
Conflicts:
engines/configure.engines
engines/engines.mk
engines/plugins_table.h
Diffstat (limited to 'engines/wintermute/base/scriptables')
-rw-r--r-- | engines/wintermute/base/scriptables/script_ext_string.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp index b6d284442d..65bec03bc1 100644 --- a/engines/wintermute/base/scriptables/script_ext_string.cpp +++ b/engines/wintermute/base/scriptables/script_ext_string.cpp @@ -298,21 +298,13 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack uint32 start = 0; for(uint32 i = 0; i < str.size() + 1; i++) { - char ch = str.c_str()[i]; - if(ch=='\0' || delims.contains(ch)) - { - char *part = new char[i - start + 1]; - if(i != start) { - Common::strlcpy(part, str.c_str() + start, i - start + 1); - part[i - start] = '\0'; + uint32 ch = str[i]; + if (ch =='\0' || delims.contains(ch)) { + if (i != start) { + parts.push_back(WideString(str.c_str() + start, i - start + 1)); } else { - part[0] = '\0'; + parts.push_back(WideString()); } - val = new ScValue(_gameRef, part); - array->push(val); - delete[] part; - delete val; - val = nullptr; start = i + 1; } } |