aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-14 15:29:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-14 15:29:55 +0000
commit17c13ea0e8971049b457404db79d9906a2ef8ec6 (patch)
tree71415043ef243c4e6441b0f109e7ea7eee245e15 /src/playlist.c
parent77f824ce20ff4eba8b969f389794a83668d9dc8a (diff)
downloadmpd-17c13ea0e8971049b457404db79d9906a2ef8ec6.tar.gz
mpd-17c13ea0e8971049b457404db79d9906a2ef8ec6.tar.xz
mpd-17c13ea0e8971049b457404db79d9906a2ef8ec6.zip
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
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c8
1 files 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--;