summaryrefslogtreecommitdiff
path: root/src/shared/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-03-23 18:55:36 +0700
committerLennart Poettering <lennart@poettering.net>2015-03-26 11:56:22 +0100
commit4034a06ddb82ec9868cd52496fef2f5faa25575f (patch)
treea832cd56abb7830985f3e7e9dff7451b96478c24 /src/shared/strv.c
parentbe3ce3014eacd66fa292fc9e4e6b3d3b0ef7de23 (diff)
util: rework word parsing and c unescaping code
When parsing words from input files, optionally automatically unescape the passed strings, controllable via a new flags parameter. Make use of this in tmpfiles, and port everything else over, too. This improves parsing quite a bit, since we no longer have to process the same string multiple times with different calls, where an earlier call might corrupt the input for a later call.
Diffstat (limited to 'src/shared/strv.c')
-rw-r--r--src/shared/strv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index 8c6ba6a633..d44a72fc48 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -278,7 +278,7 @@ char **strv_split_newlines(const char *s) {
return l;
}
-int strv_split_quoted(char ***t, const char *s, bool relax) {
+int strv_split_quoted(char ***t, const char *s, UnquoteFlags flags) {
size_t n = 0, allocated = 0;
_cleanup_strv_free_ char **l = NULL;
int r;
@@ -289,7 +289,7 @@ int strv_split_quoted(char ***t, const char *s, bool relax) {
for (;;) {
_cleanup_free_ char *word = NULL;
- r = unquote_first_word(&s, &word, relax);
+ r = unquote_first_word(&s, &word, flags);
if (r < 0)
return r;
if (r == 0)