]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/vpick: drop unneeded strempty()
authorMike Yuan <me@yhndnzj.com>
Mon, 15 Apr 2024 17:37:34 +0000 (01:37 +0800)
committerMike Yuan <me@yhndnzj.com>
Mon, 15 Apr 2024 17:38:08 +0000 (01:38 +0800)
prefix_roota() handles NULL root param gracefully.

src/shared/vpick.c

index 5e2b34e7b08b1fe399aac8d0ed1be5fd2258895b..c4c8accb3766cdf4e43123e2954f232f2e3a9a84 100644 (file)
@@ -143,8 +143,6 @@ static int pin_choice(
         assert(filter);
         assert(ret);
 
-        toplevel_path = strempty(toplevel_path);
-
         if (inode_fd < 0 || FLAGS_SET(flags, PICK_RESOLVE)) {
                 r = chaseat(toplevel_fd,
                             inode_path,
@@ -274,8 +272,6 @@ static int make_choice(
         assert(filter);
         assert(ret);
 
-        toplevel_path = strempty(toplevel_path);
-
         if (inode_fd < 0) {
                 r = chaseat(toplevel_fd, inode_path, CHASE_AT_RESOLVE_IN_ROOT, NULL, &inode_fd);
                 if (r < 0)
@@ -506,8 +502,6 @@ int path_pick(
         assert(filter);
         assert(ret);
 
-        toplevel_path = strempty(toplevel_path);
-
         /* Given a path, resolve .v/ subdir logic (if used!), and returns the choice made. This supports
          * three ways to be called:
          *