mirror of
https://github.com/curl/curl.git
synced 2025-09-20 11:02:42 +03:00
curl_strequal: part of public API/ABI, needs to be kept
These two public functions have been mentioned as deprecated since a very long time but since they are still part of the API and ABI we need to keep them around.
This commit is contained in:
parent
44c53cc38b
commit
8fe4bd0844
|
@ -73,8 +73,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define curlx_getenv curl_getenv
|
#define curlx_getenv curl_getenv
|
||||||
#define curlx_strcasecompare curl_strcasecompare
|
#define curlx_strcasecompare curl_strequal
|
||||||
#define curlx_strncasecompare curl_strncasecompare
|
#define curlx_strncasecompare curl_strnequal
|
||||||
#define curlx_mvsnprintf curl_mvsnprintf
|
#define curlx_mvsnprintf curl_mvsnprintf
|
||||||
#define curlx_msnprintf curl_msnprintf
|
#define curlx_msnprintf curl_msnprintf
|
||||||
#define curlx_maprintf curl_maprintf
|
#define curlx_maprintf curl_maprintf
|
||||||
|
|
|
@ -102,7 +102,7 @@ char Curl_raw_toupper(char in)
|
||||||
* @unittest: 1301
|
* @unittest: 1301
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int curl_strcasecompare(const char *first, const char *second)
|
int Curl_strcasecompare(const char *first, const char *second)
|
||||||
{
|
{
|
||||||
while(*first && *second) {
|
while(*first && *second) {
|
||||||
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
|
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
|
||||||
|
@ -120,7 +120,7 @@ int curl_strcasecompare(const char *first, const char *second)
|
||||||
/*
|
/*
|
||||||
* @unittest: 1301
|
* @unittest: 1301
|
||||||
*/
|
*/
|
||||||
int curl_strncasecompare(const char *first, const char *second, size_t max)
|
int Curl_strncasecompare(const char *first, const char *second, size_t max)
|
||||||
{
|
{
|
||||||
while(*first && *second && max) {
|
while(*first && *second && max) {
|
||||||
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
|
if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
|
||||||
|
@ -150,3 +150,14 @@ void Curl_strntoupper(char *dest, const char *src, size_t n)
|
||||||
*dest++ = Curl_raw_toupper(*src);
|
*dest++ = Curl_raw_toupper(*src);
|
||||||
} while(*src++ && --n);
|
} while(*src++ && --n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- public functions --- */
|
||||||
|
|
||||||
|
int curl_strequal(const char *first, const char *second)
|
||||||
|
{
|
||||||
|
return Curl_strcasecompare(first, second);
|
||||||
|
}
|
||||||
|
int curl_strnequal(const char *first, const char *second, size_t max)
|
||||||
|
{
|
||||||
|
return Curl_strncasecompare(first, second, max);
|
||||||
|
}
|
||||||
|
|
|
@ -32,11 +32,11 @@
|
||||||
* non-ascii.
|
* non-ascii.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define strcasecompare(a,b) curl_strcasecompare(a,b)
|
#define strcasecompare(a,b) Curl_strcasecompare(a,b)
|
||||||
#define strncasecompare(a,b,c) curl_strncasecompare(a,b,c)
|
#define strncasecompare(a,b,c) Curl_strncasecompare(a,b,c)
|
||||||
|
|
||||||
int curl_strcasecompare(const char *first, const char *second);
|
int Curl_strcasecompare(const char *first, const char *second);
|
||||||
int curl_strncasecompare(const char *first, const char *second, size_t max);
|
int Curl_strncasecompare(const char *first, const char *second, size_t max);
|
||||||
|
|
||||||
char Curl_raw_toupper(char in);
|
char Curl_raw_toupper(char in);
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
|
||||||
keepit = *end;
|
keepit = *end;
|
||||||
*end = 0; /* zero terminate */
|
*end = 0; /* zero terminate */
|
||||||
for(i = 0; replacements[i].name; i++) {
|
for(i = 0; replacements[i].name; i++) {
|
||||||
if(curl_strcasecompare(ptr, replacements[i].name)) {
|
if(curl_strequal(ptr, replacements[i].name)) {
|
||||||
match = TRUE;
|
match = TRUE;
|
||||||
switch(replacements[i].id) {
|
switch(replacements[i].id) {
|
||||||
case VAR_EFFECTIVE_URL:
|
case VAR_EFFECTIVE_URL:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user