diff options
author | Max Kellermann <max@duempel.org> | 2012-04-05 00:45:39 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-04-05 00:45:39 +0200 |
commit | c22cbbf8280bb35c8fee5ae3931d3bc08b70099f (patch) | |
tree | 4654b9834f51c32746e2f72ce64191149647d87e /src/directory.c | |
parent | f930f37d35995f0fc07f70aefc41babc0db1757e (diff) | |
parent | 5acee73fc85e44179120a5818247fc0760038cff (diff) | |
download | mpd-c22cbbf8280bb35c8fee5ae3931d3bc08b70099f.tar.gz mpd-c22cbbf8280bb35c8fee5ae3931d3bc08b70099f.tar.xz mpd-c22cbbf8280bb35c8fee5ae3931d3bc08b70099f.zip |
Merge branch 'v0.16.x'
Conflicts:
src/output/osx_plugin.c
src/text_input_stream.c
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 * |