aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-05-24 17:06:59 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-05-24 17:06:59 +0000
commitc408bd5e903da0441f461aa564095ec581cb3cfd (patch)
tree40e464e712dbed7b55f45bc9f62b3b11388e31fe /src/directory.c
parent93b96edacc4a3a3e0ca32bec6cdbf96a1c068850 (diff)
downloadmpd-c408bd5e903da0441f461aa564095ec581cb3cfd.tar.gz
mpd-c408bd5e903da0441f461aa564095ec581cb3cfd.tar.xz
mpd-c408bd5e903da0441f461aa564095ec581cb3cfd.zip
Don't list playlists in lsinfo if the path isn't the root directory (they
can't be loaded anyway). git-svn-id: https://svn.musicpd.org/mpd/trunk@6244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/directory.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/directory.c b/src/directory.c
index 4c94e6be9..fb18ff91b 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -835,13 +835,21 @@ static Directory *findSubDirectory(Directory * directory, char *name)
return NULL;
}
+int isRootDirectory(char *name)
+{
+ if (name == NULL || name[0] == '\0' || strcmp(name, "/") == 0) {
+ return 1;
+ }
+ return 0;
+}
+
static Directory *getSubDirectory(Directory * directory, char *name,
char **shortname)
{
Directory *subDirectory;
int len;
- if (name == NULL || name[0] == '\0' || strcmp(name, "/") == 0) {
+ if (isRootDirectory(name)) {
return directory;
}