]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-lookup: shortcut patch_root_prefix() if no root_dir
authorMike Yuan <me@yhndnzj.com>
Sun, 25 Aug 2024 18:18:58 +0000 (20:18 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 6 Oct 2024 17:32:54 +0000 (19:32 +0200)
src/libsystemd/sd-path/path-lookup.c

index d37da14ec6140bc5ecbe331b0097734699c53343..673a255685c640a304341ad0999e96e5b5027e23 100644 (file)
@@ -342,6 +342,9 @@ static int patch_root_prefix(char **p, const char *root_dir) {
 
         assert(p);
 
+        if (!root_dir)
+                return 0;
+
         if (!*p)
                 return 0;