]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/modules-load/modules-load.c
tree-wide: port various parsers over to read_stripped_line()
[thirdparty/systemd.git] / src / modules-load / modules-load.c
index 4adeef3afbddcf974a490219a40a60ab6375007b..efca2379eac71e5850cfaa897e6fd166e55048c8 100644 (file)
@@ -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);