]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
strv: allow to set separator NULL in strv_split() or strv_split_full()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Sep 2018 10:20:43 +0000 (19:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Sep 2018 10:20:43 +0000 (19:20 +0900)
src/basic/strv.c

index ffc7b98d702e8a1ed3312d782a933c0bbca48be6..0647a472d70482af8df22cb8e6a9eb0a541003a1 100644 (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);