diff options
author | Max Kellermann <max@duempel.org> | 2009-02-04 21:04:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-04 21:04:30 +0100 |
commit | 60bec7766494b2f904658006dfc217d241f44ce8 (patch) | |
tree | 4395f0db4fac3bc26d3b43ba0098db7f1308d18c /src/command.c | |
parent | f81728592278c667f4928d5201cd7932d6c4e8aa (diff) | |
download | mpd-60bec7766494b2f904658006dfc217d241f44ce8.tar.gz mpd-60bec7766494b2f904658006dfc217d241f44ce8.tar.xz mpd-60bec7766494b2f904658006dfc217d241f44ce8.zip |
playlist_print: use bool instead of int
Return true on success, instead of 0. Converted the "detail"
parameter to bool.
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/command.c b/src/command.c index 14991740e..36c070f0e 100644 --- a/src/command.c +++ b/src/command.c @@ -686,26 +686,30 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) static enum command_return handle_listplaylist(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) { - int ret; + bool ret; - ret = spl_print(client, argv[1], 0); - if (ret == -1) + ret = spl_print(client, argv[1], false); + if (!ret) { command_error(client, ACK_ERROR_NO_EXIST, "No such playlist"); + return COMMAND_RETURN_ERROR; + } - return ret; + return COMMAND_RETURN_OK; } static enum command_return handle_listplaylistinfo(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) { - int ret; + bool ret; - ret = spl_print(client, argv[1], 1); - if (ret == -1) + ret = spl_print(client, argv[1], true); + if (!ret) { command_error(client, ACK_ERROR_NO_EXIST, "No such playlist"); + return COMMAND_RETURN_ERROR; + } - return ret; + return COMMAND_RETURN_OK; } static enum command_return |