From 3b6ff84393985aa9d148d2c00c49630ed2590d7d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 Oct 2008 16:32:39 +0200 Subject: directory: added directory_get_name() directory_get_name() returns the base name of the directory. --- src/directory.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/directory.c') diff --git a/src/directory.c b/src/directory.c index 002cb65e3..f11695a95 100644 --- a/src/directory.c +++ b/src/directory.c @@ -18,6 +18,7 @@ #include "directory.h" #include "utils.h" +#include "path.h" #include #include @@ -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) { -- cgit v1.2.3