From 3884c89a2ec5378f54ebbaf4402d9d5438e80b92 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 7 Sep 2008 13:44:20 +0200 Subject: playlist: PlaylistInfo() does not call commandError() Continuing the effort of removing protocol specific calls from the core libraries: let the command.c code call commandError() based on PlaylistInfo's return value. --- src/command.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index 1634394d0..59a99141a 100644 --- a/src/command.c +++ b/src/command.c @@ -538,13 +538,25 @@ static int handleLoad(int fd, mpd_unused int *permission, static int handleListPlaylist(int fd, mpd_unused int *permission, mpd_unused int argc, char *argv[]) { - return PlaylistInfo(fd, argv[1], 0); + int ret; + + ret = PlaylistInfo(fd, argv[1], 0); + if (ret == -1) + commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist"); + + return ret; } static int handleListPlaylistInfo(int fd, mpd_unused int *permission, mpd_unused int argc, char *argv[]) { - return PlaylistInfo(fd, argv[1], 1); + int ret; + + ret = PlaylistInfo(fd, argv[1], 1); + if (ret == -1) + commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist"); + + return ret; } static int handleLsInfo(int fd, mpd_unused int *permission, -- cgit v1.2.3