diff options
-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 fa15d41b1..1e3a4cf28 100644 --- a/src/directory.c +++ b/src/directory.c @@ -68,7 +68,15 @@ directory_free(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; } void |