util: remove path_get_parent(), in favour of dirname_malloc()

We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-util.[ch].
This commit is contained in:
Lennart Poettering
2015-10-27 13:25:55 +01:00
parent e4e73a6325
commit 5f311f8c0e
15 changed files with 62 additions and 108 deletions
-18
View File
@@ -398,24 +398,6 @@ int dir_is_empty(const char *path) {
return 1;
}
char* dirname_malloc(const char *path) {
char *d, *dir, *dir2;
d = strdup(path);
if (!d)
return NULL;
dir = dirname(d);
assert(dir);
if (dir != d) {
dir2 = strdup(dir);
free(d);
return dir2;
}
return dir;
}
void rename_process(const char name[8]) {
assert(name);