]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/unit-name.c
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / basic / unit-name.c
index 13653d9b7838c469a8ed11bd008f1e855c0e7ccb..8115bff14ae8953cc861bd5aabf4095e49537179 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 /***
-  This file is part of systemd.
-
   Copyright 2010 Lennart Poettering
 ***/
 
@@ -383,9 +381,9 @@ int unit_name_path_escape(const char *f, char **ret) {
         if (!p)
                 return -ENOMEM;
 
-        path_kill_slashes(p);
+        path_simplify(p, false);
 
-        if (STR_IN_SET(p, "/", ""))
+        if (empty_or_root(p))
                 s = strdup("-");
         else {
                 if (!path_is_normalized(p))
@@ -710,7 +708,7 @@ int slice_build_parent_slice(const char *slice, char **ret) {
         return 1;
 }
 
-int slice_build_subslice(const char *slice, const char*name, char **ret) {
+int slice_build_subslice(const char *slice, const char *name, char **ret) {
         char *subslice;
 
         assert(slice);