From c55473abebfbac95d767ba758bafa8c8b90b5cd5 Mon Sep 17 00:00:00 2001
From: Maarten Sebregts <maartensebregts@gmail.com>
Date: Mon, 19 Dec 2011 21:15:00 +0100
Subject: [PATCH] Playlist: fix bug in moving after current song

Moving songs using either 'move' or 'moveid' to position -1 (after the
current song) would fail for a song which is just before the current
song.
This patch corrects the check to see if the current song is in the range
to be moved. Since the range is from `start` up to `end` (exclusive) the
check was incorrect, but is now fixed.
---
 src/playlist_edit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/playlist_edit.c b/src/playlist_edit.c
index 92c3d44..dbd205a 100644
--- a/src/playlist_edit.c
+++ b/src/playlist_edit.c
@@ -418,7 +418,7 @@ playlist_move_range(struct playlist *playlist, struct player_control *pc,
 					      playlist->current)
 		: -1;
 	if (to < 0 && playlist->current >= 0) {
-		if (start <= (unsigned)currentSong && (unsigned)currentSong <= end)
+		if (start <= (unsigned)currentSong && (unsigned)currentSong < end)
 			/* no-op, can't be moved to offset of itself */
 			return PLAYLIST_RESULT_SUCCESS;
 		to = (currentSong + abs(to)) % queue_length(&playlist->queue);
-- 
1.7.5.4

