Fix crash in tab completion if one command is a prefix of another.
svn-id: r42597
This commit is contained in:
parent
d362ca86f6
commit
66b565c9c2
1 changed files with 2 additions and 1 deletions
|
@ -307,7 +307,8 @@ bool Debugger::tabComplete(const char *input, Common::String &completion) const
|
|||
} else {
|
||||
// take common prefix of previous match and this command
|
||||
for (uint j = 0; j < completion.size(); j++) {
|
||||
if (completion[j] != i->_key[inputlen + j]) {
|
||||
if (inputlen + j >= i->_key.size() ||
|
||||
completion[j] != i->_key[inputlen + j]) {
|
||||
completion = Common::String(completion.begin(), completion.begin() + j);
|
||||
// If there is no unambiguous completion, abort
|
||||
if (completion.empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue