X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fconf-parser.c;h=438b4cc3d57a7e4e7b59671dd283fdf03a952f45;hp=df3584dd04567bbc73272b2aebb6dd56c81803a1;hb=6f0d624ec785409ad82c2e3afb786d977f2b1c87;hpb=3dab29438c431f8e068c079af13ed26a81e563d3 diff --git a/src/conf-parser.c b/src/conf-parser.c index df3584dd0..438b4cc3d 100644 --- a/src/conf-parser.c +++ b/src/conf-parser.c @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. @@ -122,7 +122,7 @@ static int parse_line(const char *filename, unsigned line, char **section, const return 0; } - if (sections && !strv_contains((char**) sections, *section)) + if (sections && (!*section || !strv_contains((char**) sections, *section))) return 0; if (!(e = strchr(l, '='))) { @@ -423,7 +423,7 @@ int config_parse_strv( 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; @@ -475,7 +475,7 @@ int config_parse_path_strv( 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; }