diff options
author | Filippos Karapetis | 2014-10-15 18:51:14 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-10-15 18:51:14 +0300 |
commit | e6d1337e115d4a49d9103e33b1e75133d237e090 (patch) | |
tree | 5c4c4b229dc6284b69534a730d8ead102ab7a286 | |
parent | 33b770ac60354b3a8bea89bc5babe3f5c0ebf4dc (diff) | |
download | scummvm-rg350-e6d1337e115d4a49d9103e33b1e75133d237e090.tar.gz scummvm-rg350-e6d1337e115d4a49d9103e33b1e75133d237e090.tar.bz2 scummvm-rg350-e6d1337e115d4a49d9103e33b1e75133d237e090.zip |
SCI: Ignore most of the non-alphanumeric characters in the parser
This is a more proper handling of non-alphanumeric characters (e.g.
apostrophes) in SCI games with a parser - bug #6608
-rw-r--r-- | engines/sci/parser/vocabulary.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 3344b79e26..7fc02dc9a0 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -535,9 +535,9 @@ bool Vocabulary::tokenizeString(ResultWordListList &retval, const char *sentence if (Common::isAlnum(c) || (c == '-' && wordLen) || (c >= 0x80)) { currentWord[wordLen] = lowerCaseMap[c]; ++wordLen; - } else if (c == '\'' && wordLen && (sentence[pos_in_sentence] == 's' || sentence[pos_in_sentence] == 'S')) { - // Skip apostrophe-s at the end of the word, if it exists - pos_in_sentence++; // skip the 's' + } else if (!Common::isAlpha(c) && c != '-' && c != ' ' && c != '\0' && (g_sci->getLanguage() != Common::JA_JPN)) { + // Skip non-alphanumeric characters in the string. + // Note: hyphens ('-'), spaces and string terminators are handled in the other branches. } else { // Continue on this word. Words may contain a '-', but may not start with // one. |