directory: printDirectoryInfo() does not call commandError()
Move another ocurrence of error handling over to command.c.
This commit is contained in:
parent
f320c9fa1d
commit
17b6491bcf
@ -575,8 +575,10 @@ static int handleLsInfo(int fd, mpd_unused int *permission,
|
|||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
path = argv[1];
|
path = argv[1];
|
||||||
|
|
||||||
if (printDirectoryInfo(fd, path) < 0)
|
if (printDirectoryInfo(fd, path) < 0) {
|
||||||
|
commandError(fd, ACK_ERROR_NO_EXIST, "directory not found");
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (isRootDirectory(path))
|
if (isRootDirectory(path))
|
||||||
return lsPlaylists(fd, path);
|
return lsPlaylists(fd, path);
|
||||||
|
@ -850,10 +850,8 @@ int printDirectoryInfo(int fd, const char *name)
|
|||||||
{
|
{
|
||||||
Directory *directory;
|
Directory *directory;
|
||||||
|
|
||||||
if ((directory = getDirectory(name)) == NULL) {
|
if ((directory = getDirectory(name)) == NULL)
|
||||||
commandError(fd, ACK_ERROR_NO_EXIST, "directory not found");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
printDirectoryList(fd, directory->subDirectories);
|
printDirectoryList(fd, directory->subDirectories);
|
||||||
printSongInfoFromList(fd, directory->songs);
|
printSongInfoFromList(fd, directory->songs);
|
||||||
|
Loading…
Reference in New Issue
Block a user