Add new helper for case insensitive string comparison

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-07-23 17:48:15 +09:00
parent 70e1938aa7
commit dcf94bef56

View file

@ -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;