From 0353a24400c9f5903af510e59c5e831a846a51f5 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 13 Apr 2018 20:43:08 +0200 Subject: [PATCH] tweaks: rearrange a few if statements more symmetrically --- src/utils.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils.c b/src/utils.c index 40f9348d..9e500bef 100644 --- a/src/utils.c +++ b/src/utils.c @@ -325,15 +325,18 @@ const char *strstrwrapper(const char *haystack, const char *needle, else return haystack + regmatches[0].rm_so; } + if (ISSET(CASE_SENSITIVE)) { if (ISSET(BACKWARDS_SEARCH)) return revstrstr(haystack, needle, start); else return strstr(start, needle); - } else if (ISSET(BACKWARDS_SEARCH)) - return mbrevstrcasestr(haystack, needle, start); + } - return mbstrcasestr(start, needle); + if (ISSET(BACKWARDS_SEARCH)) + return mbrevstrcasestr(haystack, needle, start); + else + return mbstrcasestr(start, needle); } /* This is a wrapper for the perror() function. The wrapper temporarily