/* SPDX-License-Identifier: LGPL-2.1+ */
/***
- This file is part of systemd.
-
Copyright 2010 Lennart Poettering
***/
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))
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);