diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-26 19:20:43 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-26 19:20:43 +0900 |
commit | 2c3a11d86efdf54493ac18719af5aa76b0483d51 (patch) | |
tree | eaea09a547e413f0744005cf9f8201b4516fb479 /src/basic/strv.c | |
parent | af0b60b37c8bc5e5206d41e00f31f2682a51f21e (diff) | |
download | systemd-2c3a11d86efdf54493ac18719af5aa76b0483d51.tar.gz |
strv: allow to set separator NULL in strv_split() or strv_split_full()
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r-- | src/basic/strv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c index ffc7b98d70..0647a472d7 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); |