strv: allow to set separator NULL in strv_split() or strv_split_full()

This commit is contained in:
Yu Watanabe 2018-09-26 19:20:43 +09:00
parent af0b60b37c
commit 2c3a11d86e
1 changed files with 3 additions and 0 deletions

View File

@ -253,6 +253,9 @@ char **strv_split_full(const char *s, const char *separator, bool quoted) {
assert(s);
if (!separator)
separator = WHITESPACE;
s += strspn(s, separator);
if (isempty(s))
return new0(char*, 1);