diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-26 15:17:40 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-26 15:48:17 +0200 |
commit | 8059aa9c92fe1f9847fc33b11670d3f48ad92fb4 (patch) | |
tree | 0c6a66ae805e1bf4d6477d36d5b20c8b409b3d8c /src/basic/strv.h | |
parent | strv: allow to set separator NULL in strv_split() or strv_split_full() (diff) | |
download | systemd-8059aa9c92fe1f9847fc33b11670d3f48ad92fb4.tar.xz systemd-8059aa9c92fe1f9847fc33b11670d3f48ad92fb4.zip |
strv: introduce 'relax' mode to strv_split_full()
If SPLIT_RELAX is specified, then it accepts unfinished quotes or
missing separator after right quote.
Diffstat (limited to 'src/basic/strv.h')
-rw-r--r-- | src/basic/strv.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/basic/strv.h b/src/basic/strv.h index 03fb5cc2b2..e9e6063f58 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -9,6 +9,7 @@ #include "alloc-util.h" #include "extract-word.h" #include "macro.h" +#include "string-util.h" #include "util.h" char *strv_find(char **l, const char *name) _pure_; @@ -66,9 +67,9 @@ static inline bool strv_isempty(char * const *l) { return !l || !*l; } -char **strv_split_full(const char *s, const char *separator, bool quoted); +char **strv_split_full(const char *s, const char *separator, SplitFlags flags); static inline char **strv_split(const char *s, const char *separator) { - return strv_split_full(s, separator, false); + return strv_split_full(s, separator, 0); } char **strv_split_newlines(const char *s); |