From 097d6c3c5b910e03c934fd7db6ed384ac771912a Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 9 May 2019 01:22:23 -0500 Subject: [PATCH] Fix order of operations in tilde comparison The previous form of the statement evaluated to a constant comparison and couldn't have been what was actually intended. --- src/complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/complete.cpp b/src/complete.cpp index e6b9e20fe..fc9ecb11d 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -245,7 +245,7 @@ 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.back() == L'~' < b.completion.back() == L'~'; + 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 *comps) {