From: Yu Watanabe Date: Wed, 26 Sep 2018 10:20:43 +0000 (+0900) Subject: strv: allow to set separator NULL in strv_split() or strv_split_full() X-Git-Tag: v240~630^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c3a11d86efdf54493ac18719af5aa76b0483d51;p=thirdparty%2Fsystemd.git strv: allow to set separator NULL in strv_split() or strv_split_full() --- diff --git a/src/basic/strv.c b/src/basic/strv.c index ffc7b98d702..0647a472d70 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -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);