Code

screen_play: check the result of mpd_connection_clear_error()
authorMax Kellermann <max@duempel.org>
Thu, 1 Oct 2009 21:31:43 +0000 (23:31 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 1 Oct 2009 21:31:43 +0000 (23:31 +0200)
src/screen_play.c

index aee7e600482806f63d65ad9698e0910a7e43eb7d..79479bb032e8bf59328fd647882920f57d3159a6 100644 (file)
@@ -327,12 +327,11 @@ playlist_save(struct mpdclient *c, char *name, char *defaultname)
 
        if (!mpd_run_save(c->connection, filename_utf8)) {
                if (mpd_connection_get_error(c->connection) == MPD_ERROR_SERVER &&
-                   mpd_connection_get_server_error(c->connection) == MPD_SERVER_ERROR_EXIST) {
+                   mpd_connection_get_server_error(c->connection) == MPD_SERVER_ERROR_EXIST &&
+                   mpd_connection_clear_error(c->connection)) {
                        char *buf;
                        int key;
 
-                       mpd_connection_clear_error(c->connection);
-
                        buf = g_strdup_printf(_("Replace %s [%s/%s] ? "),
                                              filename, YES, NO);
                        key = tolower(screen_getch(buf));