summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-23 17:48:15 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-24 09:53:24 +0900
commitdcf94bef56d93a99649d0cc8ea106b1d0cc3fc7c (patch)
tree9ee3a540c3218ad89ea47734a83ce87f243c28e6
parent70e1938aa770b99c8c0de2122787a28145da97cb (diff)
downloadsubsurface-dcf94bef56d93a99649d0cc8ea106b1d0cc3fc7c.tar.gz
Add new helper for case insensitive string comparison
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--core/dive.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/dive.h b/core/dive.h
index eaca66626..ae980947a 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -30,6 +30,11 @@ static inline int same_string(const char *a, const char *b)
return !strcmp(a ?: "", b ?: "");
}
+static inline int same_string_caseinsensitive(const char *a, const char *b)
+{
+ return !strcasecmp(a ?: "", b ?: "");
+}
+
static inline char *copy_string(const char *s)
{
return (s && *s) ? strdup(s) : NULL;