aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2014-08-08 03:59:02 +0300
committerFilippos Karapetis2014-08-08 03:59:02 +0300
commite11fe13620be4b500c91b6141337786948c13694 (patch)
treec19d6c619c2981335d38309566d684912a9c53bc
parent593c8c9bed4b697f63166eef4677788e01f9aec2 (diff)
downloadscummvm-rg350-e11fe13620be4b500c91b6141337786948c13694.tar.gz
scummvm-rg350-e11fe13620be4b500c91b6141337786948c13694.tar.bz2
scummvm-rg350-e11fe13620be4b500c91b6141337786948c13694.zip
SCI: Handle 's at the end of words - bug #6608
-rw-r--r--engines/sci/parser/vocabulary.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index b4a223dcff..3344b79e26 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -530,18 +530,19 @@ bool Vocabulary::tokenizeString(ResultWordListList &retval, const char *sentence
*error = NULL;
do {
-
c = sentence[pos_in_sentence++];
+
if (Common::isAlnum(c) || (c == '-' && wordLen) || (c >= 0x80)) {
currentWord[wordLen] = lowerCaseMap[c];
++wordLen;
- }
- // Continue on this word */
- // Words may contain a '-', but may not
- // start with one.
- else {
- if (wordLen) { // Finished a word?
+ } 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 {
+ // Continue on this word. Words may contain a '-', but may not start with
+ // one.
+ if (wordLen) { // Finished a word?
ResultWordList lookup_result;
// Look it up