Shell: Don't crash when there are no tab completions available :D

This commit is contained in:
Bananymous 2024-10-07 14:26:07 +03:00
parent 9775e83374
commit f67cad326a
1 changed files with 5 additions and 5 deletions

View File

@ -1509,12 +1509,12 @@ int main(int argc, char** argv)
} }
); );
for (size_t i = 0; i < completions.size() - 1; i++) for (size_t i = 1; i < completions.size();)
{ {
if (completions[i] != completions[i + 1]) if (completions[i - 1] == completions[i])
continue; completions.remove(i);
completions.remove(i + 1); else
i--; i++;
} }
if (completions.empty()) if (completions.empty())