tree-wide: port various parsers over to read_stripped_line()

This commit is contained in:
Lennart Poettering
2023-10-17 14:36:54 +02:00
parent c56cb33f09
commit 0ff6ff2b29
26 changed files with 127 additions and 194 deletions
+5 -6
View File
@@ -238,10 +238,10 @@ static int parse_file(OrderedHashmap **sysctl_options, const char *path, bool ig
_cleanup_free_ char *l = NULL;
bool ignore_failure = false;
Option *existing;
char *p, *value;
char *value;
int k;
k = read_line(f, LONG_LINE_MAX, &l);
k = read_stripped_line(f, LONG_LINE_MAX, &l);
if (k == 0)
break;
if (k < 0)
@@ -249,13 +249,12 @@ static int parse_file(OrderedHashmap **sysctl_options, const char *path, bool ig
c++;
p = strstrip(l);
if (isempty(p))
if (isempty(l))
continue;
if (strchr(COMMENTS "\n", *p))
if (strchr(COMMENTS, l[0]))
continue;
char *p = l;
value = strchr(p, '=');
if (value) {
if (p[0] == '-') {