From: Pietro Cerutti Date: Fri, 9 Nov 2018 16:59:48 +0000 (+0000) Subject: mutt_str_startswith - config/sort.c - fix logic X-Git-Tag: 2019-10-25~532^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ebb9cc561813f77a837abae49d8816834813f68;p=neomutt mutt_str_startswith - config/sort.c - fix logic --- diff --git a/config/sort.c b/config/sort.c index ebc2d0f25..59cb9ef40 100644 --- a/config/sort.c +++ b/config/sort.c @@ -150,15 +150,19 @@ static int sort_string_set(const struct ConfigSet *cs, void *var, struct ConfigD } size_t plen = 0; - if ((plen = mutt_str_startswith(value, "reverse-", CASE_MATCH))) + plen = mutt_str_startswith(value, "reverse-", CASE_MATCH); + if (plen != 0) { flags |= SORT_REVERSE; + value += plen; } - else if ((plen = mutt_str_startswith(value, "last-", CASE_MATCH))) + + plen = mutt_str_startswith(value, "last-", CASE_MATCH); + if (plen != 0) { flags |= SORT_LAST; + value += plen; } - value += plen; switch (cdef->type & DT_SUBTYPE_MASK) {