From 17b6491bcf37503bbc5d6cf6cee00bd1c6ec834a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 7 Sep 2008 13:49:01 +0200 Subject: [PATCH] directory: printDirectoryInfo() does not call commandError() Move another ocurrence of error handling over to command.c. --- src/command.c | 4 +++- src/directory.c | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index 238761f74..14b1aca09 100644 --- a/src/command.c +++ b/src/command.c @@ -575,8 +575,10 @@ static int handleLsInfo(int fd, mpd_unused int *permission, if (argc == 2) path = argv[1]; - if (printDirectoryInfo(fd, path) < 0) + if (printDirectoryInfo(fd, path) < 0) { + commandError(fd, ACK_ERROR_NO_EXIST, "directory not found"); return -1; + } if (isRootDirectory(path)) return lsPlaylists(fd, path); diff --git a/src/directory.c b/src/directory.c index d72aca1de..a9cb892a8 100644 --- a/src/directory.c +++ b/src/directory.c @@ -850,10 +850,8 @@ int printDirectoryInfo(int fd, const char *name) { Directory *directory; - if ((directory = getDirectory(name)) == NULL) { - commandError(fd, ACK_ERROR_NO_EXIST, "directory not found"); + if ((directory = getDirectory(name)) == NULL) return -1; - } printDirectoryList(fd, directory->subDirectories); printSongInfoFromList(fd, directory->songs);