utils: Add case-insensitive version of strpfx()
This commit is contained in:
committed by
Andreas Steffen
parent
49032d15be
commit
32a145fdbd
@@ -112,6 +112,14 @@ static inline bool strncaseeq(const char *x, const char *y, size_t len)
|
||||
return strncasecmp(x, y, len) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that checks if a string starts with a given prefix
|
||||
*/
|
||||
static inline bool strcasepfx(const char *x, const char *prefix)
|
||||
{
|
||||
return strncaseeq(x, prefix, strlen(prefix));
|
||||
}
|
||||
|
||||
/**
|
||||
* NULL-safe strdup variant
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user