diff options
-rw-r--r-- | src/command.c | 4 | ||||
-rw-r--r-- | src/directory.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/command.c b/src/command.c index 7a2981e68..e24c93d59 100644 --- a/src/command.c +++ b/src/command.c @@ -573,8 +573,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 64d9492a8..80385929c 100644 --- a/src/directory.c +++ b/src/directory.c @@ -848,10 +848,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); |