Code

mpdclient: finish the "status" command in mpdclient_cmd_crop()
authorMax Kellermann <max@duempel.org>
Thu, 11 Jun 2009 13:18:26 +0000 (15:18 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 11 Jun 2009 13:18:26 +0000 (15:18 +0200)
The crop function calls mpd_getStatus(), but never finishes that
command.  There's a mpdclient_finish_command() call at the end of the
function, but that is supposed to finish the delete command list.

src/mpdclient.c

index fecdf493030871377af5905315ccbfff7e2231cb..7a9b661d4a305798463521858f4d0eb6a6f83af5 100644 (file)
@@ -283,11 +283,16 @@ mpdclient_cmd_pause(mpdclient_t *c, gint value)
 gint
 mpdclient_cmd_crop(mpdclient_t *c)
 {
+       gint error;
        mpd_Status *status;
        int length;
 
        mpd_sendStatusCommand(c->connection);
        status = mpd_getStatus(c->connection);
+       error = mpdclient_finish_command(c);
+       if (error)
+               return error;
+
        length = status->playlistLength - 1;
 
        if (length <= 0) {