shared/bootspec: use path_make_absolute where appropriate
authorMike Yuan <me@yhndnzj.com>
Tue, 14 May 2024 07:48:15 +0000 (15:48 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 14 May 2024 10:19:19 +0000 (18:19 +0800)
src/shared/bootspec.c

index 882d026a404c307a51143bfb0f1bec895cb7182d..188613fb9eacac53ccaf63fcf988225e661f3dad 100644 (file)
@@ -79,10 +79,7 @@ static int mangle_path(
         assert(ret);
 
         /* Spec leaves open if prefixed with "/" or not, let's normalize that */
-        if (path_is_absolute(p))
-                c = strdup(p);
-        else
-                c = strjoin("/", p);
+        c = path_make_absolute(p, "/");
         if (!c)
                 return -ENOMEM;