summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-10-31 09:45:17 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-10-31 09:45:17 +0100
commit8fe4bd084412f3085638907268c5ffd8bf93c339 (patch)
tree76559169a181041505bb214e556e8e72028c5118
parent44c53cc38bea66b7612a82fa4c9b68884b9167fa (diff)
downloadgnurl-8fe4bd084412f3085638907268c5ffd8bf93c339.tar.gz
gnurl-8fe4bd084412f3085638907268c5ffd8bf93c339.tar.bz2
gnurl-8fe4bd084412f3085638907268c5ffd8bf93c339.zip
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.
-rw-r--r--lib/curlx.h4
-rw-r--r--lib/strcase.c15
-rw-r--r--lib/strcase.h8
-rw-r--r--src/tool_writeout.c2
4 files changed, 20 insertions, 9 deletions
diff --git a/lib/curlx.h b/lib/curlx.h
index 426467b7f..101491b84 100644
--- a/lib/curlx.h
+++ b/lib/curlx.h
@@ -73,8 +73,8 @@
*/
#define curlx_getenv curl_getenv
-#define curlx_strcasecompare curl_strcasecompare
-#define curlx_strncasecompare curl_strncasecompare
+#define curlx_strcasecompare curl_strequal
+#define curlx_strncasecompare curl_strnequal
#define curlx_mvsnprintf curl_mvsnprintf
#define curlx_msnprintf curl_msnprintf
#define curlx_maprintf curl_maprintf
diff --git a/lib/strcase.c b/lib/strcase.c
index 22b9692e2..5f2b700e0 100644
--- a/lib/strcase.c
+++ b/lib/strcase.c
@@ -102,7 +102,7 @@ char Curl_raw_toupper(char in)
* @unittest: 1301
*/
-int curl_strcasecompare(const char *first, const char *second)
+int Curl_strcasecompare(const char *first, const char *second)
{
while(*first && *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
*/
-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) {
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);
} 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);
+}
diff --git a/lib/strcase.h b/lib/strcase.h
index a790653c6..932d79321 100644
--- a/lib/strcase.h
+++ b/lib/strcase.h
@@ -32,11 +32,11 @@
* non-ascii.
*/
-#define strcasecompare(a,b) curl_strcasecompare(a,b)
-#define strncasecompare(a,b,c) curl_strncasecompare(a,b,c)
+#define strcasecompare(a,b) Curl_strcasecompare(a,b)
+#define strncasecompare(a,b,c) Curl_strncasecompare(a,b,c)
-int curl_strcasecompare(const char *first, const char *second);
-int curl_strncasecompare(const char *first, const char *second, size_t max);
+int Curl_strcasecompare(const char *first, const char *second);
+int Curl_strncasecompare(const char *first, const char *second, size_t max);
char Curl_raw_toupper(char in);
diff --git a/src/tool_writeout.c b/src/tool_writeout.c
index 8b709cbe3..6e94afe42 100644
--- a/src/tool_writeout.c
+++ b/src/tool_writeout.c
@@ -126,7 +126,7 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
keepit = *end;
*end = 0; /* zero terminate */
for(i = 0; replacements[i].name; i++) {
- if(curl_strcasecompare(ptr, replacements[i].name)) {
+ if(curl_strequal(ptr, replacements[i].name)) {
match = TRUE;
switch(replacements[i].id) {
case VAR_EFFECTIVE_URL: