From 17c13ea0e8971049b457404db79d9906a2ef8ec6 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 14 Jun 2004 15:29:55 +0000 Subject: [PATCH] bug fix for deleting a song when the last song or next to last song is playing and causing playlist.current to be set to -1 git-svn-id: https://svn.musicpd.org/mpd/trunk@1479 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playlist.c b/src/playlist.c index a8094925d..1e8ab890f 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -767,12 +767,12 @@ int deleteFromPlaylist(FILE * fp, int song) { playlist_noGoToNext = 1; } - if(playlist.current>=playlist.length) { - incrPlaylistCurrent(); - } - else if(playlist.current>songOrder) { + if(playlist.current>songOrder) { playlist.current--; } + else if(playlist.current>=playlist.length) { + incrPlaylistCurrent(); + } if(playlist.queued>songOrder) { playlist.queued--;