diff options
Diffstat (limited to 'src/directory.c')
-rw-r--r-- | src/directory.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/directory.c b/src/directory.c index 662b8907f..930881129 100644 --- a/src/directory.c +++ b/src/directory.c @@ -86,7 +86,15 @@ directory_delete(struct directory *directory) const char * directory_get_name(const struct directory *directory) { - return g_basename(directory->path); + assert(!directory_is_root(directory)); + assert(directory->path != NULL); + + const char *slash = strrchr(directory->path, '/'); + assert((slash == NULL) == directory_is_root(directory->parent)); + + return slash != NULL + ? slash + 1 + : directory->path; } struct directory * |