tests/server: make use of strcasecompare from lib/

... instead of having a second private implementation.

Idea triggered by #9830

Closes #9831
This commit is contained in:
Daniel Stenberg 2022-10-30 19:57:20 +01:00
parent a55256cfb2
commit 02186a6605
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 1 additions and 25 deletions

View 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 = \

View 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)