]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server: make use of strcasecompare from lib/
authorDaniel Stenberg <daniel@haxx.se>
Sun, 30 Oct 2022 18:57:20 +0000 (19:57 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 30 Oct 2022 21:23:58 +0000 (22:23 +0100)
... instead of having a second private implementation.

Idea triggered by #9830

Closes #9831

tests/server/Makefile.inc
tests/server/util.c

index ccc65d2b80d2ad76e297e2a93c27fb756d60513c..0c767121483566ef83f12eb42ff51b469b81d077 100644 (file)
@@ -33,6 +33,7 @@ CURLX_SRCS = \
  ../../lib/timediff.c \
  ../../lib/dynbuf.c \
  ../../lib/strdup.c \
+ ../../lib/strcase.c \
  ../../lib/curl_multibyte.c
 
 CURLX_HDRS = \
index d2214ee6e495cb3a6703e270240603e9196d0e66..a0abf519035217b7627e8f86f1bcd6e3d4160d5c 100644 (file)
@@ -367,31 +367,6 @@ void clear_advisor_read_lock(const char *filename)
 }
 
 
-/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because
-   its behavior is altered by the current locale. */
-static char raw_toupper(char in)
-{
-  if(in >= 'a' && in <= 'z')
-    return (char)('A' + in - 'a');
-  return in;
-}
-
-int strncasecompare(const char *first, const char *second, size_t max)
-{
-  while(*first && *second && max) {
-    if(raw_toupper(*first) != raw_toupper(*second)) {
-      break;
-    }
-    max--;
-    first++;
-    second++;
-  }
-  if(0 == max)
-    return 1; /* they are equal this far */
-
-  return raw_toupper(*first) == raw_toupper(*second);
-}
-
 #if defined(WIN32) && !defined(MSDOS)
 
 static struct timeval tvnow(void)