From 8059aa9c92fe1f9847fc33b11670d3f48ad92fb4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 26 Sep 2018 22:17:40 +0900 Subject: strv: introduce 'relax' mode to strv_split_full() If SPLIT_RELAX is specified, then it accepts unfinished quotes or missing separator after right quote. --- src/basic/strv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/basic/strv.h') 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); -- cgit v1.2.3