Fix tab-completing past the end of the completions list

This commit is contained in:
Jeffrey Pfau 2014-10-10 02:56:13 -07:00
parent 0b736c9cc8
commit ef6e1f9e74
1 changed files with 3 additions and 0 deletions

View File

@ -597,6 +597,9 @@ static unsigned char _tabComplete(EditLine* elstate, int ch) {
} }
} }
} }
if (!name) {
return CC_ERROR;
}
if (_debuggerCommands[cmd + 1].name && strncasecmp(_debuggerCommands[cmd + 1].name, li->buffer, len - 1) == 0) { if (_debuggerCommands[cmd + 1].name && strncasecmp(_debuggerCommands[cmd + 1].name, li->buffer, len - 1) == 0) {
return CC_ERROR; return CC_ERROR;
} }