aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/command.c5
-rw-r--r--src/database.c9
-rw-r--r--src/database.h2
3 files changed, 4 insertions, 12 deletions
diff --git a/src/command.c b/src/command.c
index 4923ee5d5..7d1e2f306 100644
--- a/src/command.c
+++ b/src/command.c
@@ -559,15 +559,18 @@ static int handleLsInfo(int fd, mpd_unused int *permission,
int argc, char *argv[])
{
const char *path = "";
+ const struct directory *directory;
if (argc == 2)
path = argv[1];
- if (printDirectoryInfo(fd, path) < 0) {
+ if (!(directory = getDirectory(path))) {
commandError(fd, ACK_ERROR_NO_EXIST, "directory not found");
return -1;
}
+ directory_print(fd, directory);
+
if (isRootDirectory(path))
return lsPlaylists(fd, path);
diff --git a/src/database.c b/src/database.c
index b4c73db69..c0c03f3e4 100644
--- a/src/database.c
+++ b/src/database.c
@@ -110,15 +110,6 @@ int traverseAllIn(const char *name,
data);
}
-int printDirectoryInfo(int fd, const char *name)
-{
- struct directory *directory;
-
- if ((directory = getDirectory(name)) == NULL)
- return -1;
- return directory_print(fd, directory);
-}
-
static char *getDbFile(void)
{
ConfigParam *param = parseConfigFilePath(CONF_DB_FILE, 1);
diff --git a/src/database.h b/src/database.h
index e3ed64f0c..f6f320002 100644
--- a/src/database.h
+++ b/src/database.h
@@ -37,8 +37,6 @@ int traverseAllIn(const char *name,
int (*forEachSong) (struct mpd_song *, void *),
int (*forEachDir) (struct directory *, void *), void *data);
-int printDirectoryInfo(int fd, const char *name);
-
int checkDirectoryDB(void);
int writeDirectoryDB(void);