From: Viktor Szakats Date: Wed, 25 May 2022 15:24:42 +0000 (+0000) Subject: version: allow stricmp() for sorting the feature list X-Git-Tag: curl-7_84_0~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d67f41acd3c7c5f6f0ce46ae9a1c1db1457b90d3;p=thirdparty%2Fcurl.git version: allow stricmp() for sorting the feature list In CMakeLists.txt there is an attempt to detect `stricmp()`, and in certain cases, this attempt is the only successful one to detect a case-insensitive comparison function. `HAVE_STRICMP` is defined as a result, but this macro wasn't used anywhere in the source. This patch makes use of it as an alternative when alpha-sorting the `--version` feature list. Reviewed-by: Daniel Stenberg Closes #8916 --- diff --git a/src/tool_help.c b/src/tool_help.c index 7602a6926b..7998532828 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -197,6 +197,8 @@ featcomp(const void *p1, const void *p2) return strcasecmp(* (char * const *) p1, * (char * const *) p2); #elif defined(HAVE_STRCMPI) return strcmpi(* (char * const *) p1, * (char * const *) p2); +#elif defined(HAVE_STRICMP) + return stricmp(* (char * const *) p1, * (char * const *) p2); #else return strcmp(* (char * const *) p1, * (char * const *) p2); #endif