string-util: add new strdupcspn()/strdupspn()
These combine strndup() + strspn()/strcspn() into one. There are a bunch of strndupa() calls that could use similar treatment (or should be converted to strdup[c]spn(), but this commit doesn't bother with that.
This commit is contained in:
@@ -240,3 +240,6 @@ bool streq_skip_trailing_chars(const char *s1, const char *s2, const char *ok);
|
||||
char *string_replace_char(char *str, char old_char, char new_char);
|
||||
|
||||
size_t strspn_from_end(const char *str, const char *accept);
|
||||
|
||||
char *strdupspn(const char *a, const char *accept);
|
||||
char *strdupcspn(const char *a, const char *reject);
|
||||
|
||||
Reference in New Issue
Block a user