From dcf94bef56d93a99649d0cc8ea106b1d0cc3fc7c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 23 Jul 2016 17:48:15 +0900 Subject: Add new helper for case insensitive string comparison Signed-off-by: Dirk Hohndel --- core/dive.h | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3-70-g09d2