aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/directory.h')
-rw-r--r--src/directory.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/directory.h b/src/directory.h
index b378a93f1..d8a8ea2af 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -70,6 +70,14 @@ directory_is_empty(struct directory *directory)
return directory->children.nr == 0 && directory->songs.nr == 0;
}
+static inline const char *
+directory_get_path(struct directory *directory)
+{
+ if (directory->path == NULL)
+ return "";
+ return directory->path;
+}
+
void
directory_prune_empty(struct directory *directory);
@@ -94,6 +102,4 @@ directory_walk(struct directory *directory,
int (*forEachDir)(struct directory *, void *),
void *data);
-#define directory_get_path(dir) ((dir && dir->path) ? dir->path : "")
-
#endif