#include "alloc-util.h"
#include "architecture.h"
-#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
if (r < 0)
return r;
- if (endswith(h, "/"))
- cc = strappend(h, suffix);
- else
- cc = strjoin(h, "/", suffix);
+ cc = path_join(h, suffix);
if (!cc)
return -ENOMEM;
}
suffix += strspn(suffix, "/");
-
- if (endswith(ret, "/"))
- cc = strappend(ret, suffix);
- else
- cc = strjoin(ret, "/", suffix);
+ cc = path_join(ret, suffix);
free(buffer);
if (!h && home_suffix) {
e = secure_getenv("HOME");
if (e && path_is_absolute(e)) {
- if (endswith(e, "/"))
- h = strappend(e, home_suffix);
- else
- h = strjoin(e, "/", home_suffix);
+ h = path_join(e, home_suffix);
if (!h) {
strv_free(l);
j = n;
STRV_FOREACH(i, l) {
-
- if (endswith(*i, "/"))
- *j = strappend(*i, suffix);
- else
- *j = strjoin(*i, "/", suffix);
-
+ *j = path_join(*i, suffix);
if (!*j)
return -ENOMEM;