-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
#include "strv.h"
#include "log.h"
-#define COMMENTS "#;\n"
-
/* Run the user supplied parser for an assignment */
static int next_assignment(
const char *filename,
return 0;
}
- if (sections && !strv_contains((char**) sections, *section))
+ if (sections && (!*section || !strv_contains((char**) sections, *section)))
return 0;
if (!(e = strchr(l, '='))) {
k = 0;
FOREACH_WORD_QUOTED(w, l, rvalue, state)
- if (!(n[k++] = strndup(w, l)))
+ if (!(n[k++] = cunescape_length(w, l)))
goto fail;
n[k] = NULL;
n[k] = (*sv)[k];
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (!(n[k] = strndup(w, l))) {
+ if (!(n[k] = cunescape_length(w, l))) {
r = -ENOMEM;
goto fail;
}