aboutsummaryrefslogtreecommitdiff
path: root/lib/strcase.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strcase.c')
-rw-r--r--lib/strcase.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/strcase.c b/lib/strcase.c
index 807689ef8..ccbaac176 100644
--- a/lib/strcase.c
+++ b/lib/strcase.c
@@ -120,6 +120,16 @@ int Curl_strcasecompare(const char *first, const char *second)
return (Curl_raw_toupper(*first) == Curl_raw_toupper(*second));
}
+int Curl_safe_strcasecompare(const char *first, const char *second)
+{
+ if(first && second)
+ /* both pointers point to something then compare them */
+ return Curl_strcasecompare(first, second);
+ else
+ /* if both pointers are NULL then treat them as equal */
+ return (NULL == first && NULL == second);
+}
+
/*
* @unittest: 1301
*/