aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2012-01-06 09:38:41 +0100
committerWillem Jan Palenstijn2012-01-06 09:45:11 +0100
commit41ba2433f57f064f3119b5b5c1247eadb32d5977 (patch)
tree2b50c2f221b98e1abab74cbb12af443fa979d4f5
parentf5c54bd9a36a106b05df0234c342d319f9307410 (diff)
downloadscummvm-rg350-41ba2433f57f064f3119b5b5c1247eadb32d5977.tar.gz
scummvm-rg350-41ba2433f57f064f3119b5b5c1247eadb32d5977.tar.bz2
scummvm-rg350-41ba2433f57f064f3119b5b5c1247eadb32d5977.zip
AGI: Fix predictive input binary search
Note that there are still issues with this input mode. If the binary search hits a prefix match before finding the full match, it won't recognize the full match. (Example: typing "buy" will show "buz" because it's aiming for "buzzard" without realizing "buy" exists.)
-rw-r--r--engines/agi/predictive.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 3290068d5a..56d9190e7f 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -570,7 +570,7 @@ bool AgiEngine::matchWord() {
int hi = _predictiveDictLineCount - 1;
int lo = 0;
int line = 0;
- while (lo < hi) {
+ while (lo <= hi) {
line = (lo + hi) / 2;
int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
if (cmpVal > 0)