tree-wide: port various parsers over to read_stripped_line()
This commit is contained in:
@@ -79,22 +79,20 @@ static int apply_file(struct kmod_ctx *ctx, const char *path, bool ignore_enoent
|
||||
log_debug("apply: %s", pp);
|
||||
for (;;) {
|
||||
_cleanup_free_ char *line = NULL;
|
||||
char *l;
|
||||
int k;
|
||||
|
||||
k = read_line(f, LONG_LINE_MAX, &line);
|
||||
k = read_stripped_line(f, LONG_LINE_MAX, &line);
|
||||
if (k < 0)
|
||||
return log_error_errno(k, "Failed to read file '%s': %m", pp);
|
||||
if (k == 0)
|
||||
break;
|
||||
|
||||
l = strstrip(line);
|
||||
if (isempty(l))
|
||||
if (isempty(line))
|
||||
continue;
|
||||
if (strchr(COMMENTS, *l))
|
||||
if (strchr(COMMENTS, *line))
|
||||
continue;
|
||||
|
||||
k = module_load_and_warn(ctx, l, true);
|
||||
k = module_load_and_warn(ctx, line, true);
|
||||
if (k == -ENOENT)
|
||||
continue;
|
||||
RET_GATHER(r, k);
|
||||
|
||||
Reference in New Issue
Block a user