]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
version: allow stricmp() for sorting the feature list
authorViktor Szakats <commit@vsz.me>
Wed, 25 May 2022 15:24:42 +0000 (15:24 +0000)
committerViktor Szakats <commit@vsz.me>
Wed, 25 May 2022 15:24:42 +0000 (15:24 +0000)
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

src/tool_help.c

index 7602a6926b777bb96f3f05e025288467cef68fd1..7998532828eee7b1e359819596cba45d8621d544 100644 (file)
@@ -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