mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Add new helper for case insensitive string comparison
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
70e1938aa7
commit
dcf94bef56
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue