mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 21:53:09 +08:00
Re-double-super-fix tilde completion crash
Yeah, I was too clever with the operators here. Fixes #5929.
This commit is contained in:
parent
5e78d6dcc9
commit
38a7c77e4b
|
@ -243,9 +243,15 @@ static bool compare_completions_by_duplicate_arguments(const completion_t &a,
|
|||
}
|
||||
|
||||
static bool compare_completions_by_tilde(const completion_t &a, const completion_t &b) {
|
||||
return (a.completion.empty() < b.completion.empty()) ||
|
||||
(a.completion.back() == L'~') < (b.completion.back() == L'~');
|
||||
if (a.completion.empty()) {
|
||||
return false;
|
||||
}
|
||||
if (b.completion.empty()) {
|
||||
return true;
|
||||
}
|
||||
return ((a.completion.back() == L'~') < (b.completion.back() == L'~'));
|
||||
}
|
||||
|
||||
/// Unique the list of completions, without perturbing their order.
|
||||
static void unique_completions_retaining_order(std::vector<completion_t> *comps) {
|
||||
std::unordered_set<wcstring> seen;
|
||||
|
|
Loading…
Reference in New Issue
Block a user