#include "alloc-util.h"
#include "extract-word.h"
#include "fs-util.h"
-#include "glob-util.h"
#include "log.h"
#include "macro.h"
#include "missing.h"
if (path_is_absolute(p) || !prefix)
return strdup(p);
- return strjoin(prefix, "/", p, NULL);
+ return strjoin(prefix, "/", p);
}
#endif // 0
if (!cwd)
return negative_errno();
- c = strjoin(cwd, "/", p, NULL);
+ c = strjoin(cwd, "/", p);
}
if (!c)
return -ENOMEM;
assert(path);
assert(prefix);
- /* Returns a pointer to the start of the first component after the parts matched by
- * the prefix, iff
- * - both paths are absolute or both paths are relative,
- * and
- * - each component in prefix in turn matches a component in path at the same position.
- * An empty string will be returned when the prefix and path are equivalent.
- *
- * Returns NULL otherwise.
- */
-
if ((path[0] == '/') != (prefix[0] == '/'))
return NULL;
return strjoin(root, endswith(root, "/") ? "" : "/",
path[0] == '/' ? path+1 : path,
rest ? (endswith(path, "/") ? "" : "/") : NULL,
- rest && rest[0] == '/' ? rest+1 : rest,
- NULL);
+ rest && rest[0] == '/' ? rest+1 : rest);
else
return strjoin(path,
rest ? (endswith(path, "/") ? "" : "/") : NULL,
- rest && rest[0] == '/' ? rest+1 : rest,
- NULL);
+ rest && rest[0] == '/' ? rest+1 : rest);
}
int find_binary(const char *name, char **ret) {
if (!path_is_absolute(element))
continue;
- j = strjoin(element, "/", name, NULL);
+ j = strjoin(element, "/", name);
if (!j)
return -ENOMEM;
startswith(path, "block-") ||
startswith(path, "char-");
}
-#endif // 0
int systemd_installation_has_version(const char *root, unsigned minimal_version) {
const char *pattern;
return false;
}
+#endif // 0