chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dbus: add Progress property to introspection
[elogind.git]
/
src
/
conf-parser.c
diff --git
a/src/conf-parser.c
b/src/conf-parser.c
index df3584dd04567bbc73272b2aebb6dd56c81803a1..d18b2a150daafeba8bb5259f45d8700a38ee9a01 100644
(file)
--- 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.
/***
This file is part of systemd.
@@
-31,8
+31,6
@@
#include "strv.h"
#include "log.h"
#include "strv.h"
#include "log.h"
-#define COMMENTS "#;\n"
-
/* Run the user supplied parser for an assignment */
static int next_assignment(
const char *filename,
/* Run the user supplied parser for an assignment */
static int next_assignment(
const char *filename,
@@
-122,7
+120,7
@@
static int parse_line(const char *filename, unsigned line, char **section, const
return 0;
}
return 0;
}
- if (sections &&
!strv_contains((char**) sections, *section
))
+ if (sections &&
(!*section || !strv_contains((char**) sections, *section)
))
return 0;
if (!(e = strchr(l, '='))) {
return 0;
if (!(e = strchr(l, '='))) {
@@
-423,7
+421,7
@@
int config_parse_strv(
k = 0;
FOREACH_WORD_QUOTED(w, l, rvalue, state)
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;
goto fail;
n[k] = NULL;
@@
-475,7
+473,7
@@
int config_parse_path_strv(
n[k] = (*sv)[k];
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
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;
}
r = -ENOMEM;
goto fail;
}