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.
This commit is contained in:
Lennart Poettering
2015-03-26 11:56:22 +01:00
parent be3ce3014e
commit 4034a06ddb
11 changed files with 250 additions and 175 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ static int condition_test_kernel_command_line(Condition *c) {
_cleanup_free_ char *word = NULL;
bool found;
r = unquote_first_word(&p, &word, true);
r = unquote_first_word(&p, &word, UNQUOTE_RELAX);
if (r < 0)
return r;
if (r == 0)