mirror of
https://github.com/curl/curl.git
synced 2026-08-07 22:22:56 +03:00
tests/server: stop using libcurl string comparisons
Further untangle the test server code from curl code. While the string comparison functions are available in the libcurl API, the tests servers don't link with libcurl. Use native functions instead. Closes #17328
This commit is contained in:
parent
abd400a972
commit
47896d4b59
7 changed files with 30 additions and 15 deletions
|
|
@ -232,13 +232,15 @@ int curlx_str_newline(const char **linep)
|
|||
return STRE_NEWLINE;
|
||||
}
|
||||
|
||||
/* case insensitive compare that the parsed string matches the
|
||||
given string. Returns non-zero on match. */
|
||||
#ifndef WITHOUT_LIBCURL
|
||||
/* case insensitive compare that the parsed string matches the given string.
|
||||
Returns non-zero on match. */
|
||||
int curlx_str_casecompare(struct Curl_str *str, const char *check)
|
||||
{
|
||||
size_t clen = check ? strlen(check) : 0;
|
||||
return ((str->len == clen) && strncasecompare(str->str, check, clen));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* case sensitive string compare. Returns non-zero on match. */
|
||||
int curlx_str_cmp(struct Curl_str *str, const char *check)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue