From 4034a06ddb82ec9868cd52496fef2f5faa25575f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 23 Mar 2015 18:55:36 +0700 Subject: 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. --- src/locale/localed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/locale/localed.c') diff --git a/src/locale/localed.c b/src/locale/localed.c index 1fb8cdc341..fd0eb2db55 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -227,7 +227,7 @@ static int x11_read_data(Context *c) { if (in_section && first_word(l, "Option")) { _cleanup_strv_free_ char **a = NULL; - r = strv_split_quoted(&a, l, false); + r = strv_split_quoted(&a, l, 0); if (r < 0) return r; @@ -250,7 +250,7 @@ static int x11_read_data(Context *c) { } else if (!in_section && first_word(l, "Section")) { _cleanup_strv_free_ char **a = NULL; - r = strv_split_quoted(&a, l, false); + r = strv_split_quoted(&a, l, 0); if (r < 0) return -ENOMEM; @@ -539,7 +539,7 @@ static int read_next_mapping(const char* filename, if (l[0] == 0 || l[0] == '#') continue; - r = strv_split_quoted(&b, l, false); + r = strv_split_quoted(&b, l, 0); if (r < 0) return r; -- cgit v1.2.3-54-g00ecf