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.)
(cherry picked from commit 41ba2433f5)
This commit is contained in:
Willem Jan Palenstijn 2012-01-06 09:38:41 +01:00
parent 4a0dc293b5
commit 51b354d9a6

View file

@ -566,7 +566,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)