summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-02-09 09:47:50 +0100
committerLennart Poettering <lennart@poettering.net>2022-02-09 10:17:17 +0100
commit73a4ac8a75a3d0806dde14c66e5156a246648ecd (patch)
tree3c67c5fa189ae6b09eff20ee9f594982838b2f29 /src/shared/conf-parser.c
parentdeec0b6dd53486809e25c70716dc8e5e5d168915 (diff)
downloadsystemd-73a4ac8a75a3d0806dde14c66e5156a246648ecd.tar.gz
conf-parser: minor refactorings/modernizations
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 1de8eb9474..ebbfa0d6c2 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -160,7 +160,7 @@ static int parse_line(
char **section,
unsigned *section_line,
bool *section_ignored,
- char *l,
+ char *l, /* is modified */
void *userdata) {
char *e;
@@ -171,10 +171,10 @@ static int parse_line(
assert(l);
l = strstrip(l);
- if (!*l)
+ if (isempty(l))
return 0;
- if (*l == '\n')
+ if (l[0] == '\n')
return 0;
if (!utf8_is_valid(l))
@@ -195,14 +195,14 @@ static int parse_line(
return log_oom();
if (sections && !nulstr_contains(sections, n)) {
- bool ignore = flags & CONFIG_PARSE_RELAXED;
+ bool ignore;
const char *t;
- ignore = ignore || startswith(n, "X-");
+ ignore = (flags & CONFIG_PARSE_RELAXED) || startswith(n, "X-");
if (!ignore)
NULSTR_FOREACH(t, sections)
- if (streq_ptr(n, startswith(t, "-"))) {
+ if (streq_ptr(n, startswith(t, "-"))) { /* Ignore sections prefixed with "-" in valid section list */
ignore = true;
break;
}