aboutsummaryrefslogtreecommitdiff
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-13 16:32:39 +0200
committerMax Kellermann <max@duempel.org>2008-10-13 16:32:39 +0200
commit3b6ff84393985aa9d148d2c00c49630ed2590d7d (patch)
tree3ec924094df3710505c0312171370367aca946ee /src/directory.c
parentbc85e92a722d945d193c9f3881e4ee9f96c8f2b6 (diff)
directory: added directory_get_name()
directory_get_name() returns the base name of the directory.
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/directory.c b/src/directory.c
index 002cb65e..f11695a9 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -18,6 +18,7 @@
#include "directory.h"
#include "utils.h"
+#include "path.h"
#include <assert.h>
#include <string.h>
@@ -49,6 +50,12 @@ directory_free(struct directory *directory)
/*directory_get_path(NULL); */
}
+const char *
+directory_get_name(const struct directory *directory)
+{
+ return mpd_basename(directory->path);
+}
+
void
directory_prune_empty(struct directory *directory)
{