diff options
author | Willem Jan Palenstijn | 2012-01-06 09:38:41 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2012-01-06 09:45:11 +0100 |
commit | 41ba2433f57f064f3119b5b5c1247eadb32d5977 (patch) | |
tree | 2b50c2f221b98e1abab74cbb12af443fa979d4f5 | |
parent | f5c54bd9a36a106b05df0234c342d319f9307410 (diff) | |
download | scummvm-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.cpp | 2 |
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) |