summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-10-15 17:00:16 +0200
committerMax Kellermann <max@musicpd.org>2019-10-15 17:00:16 +0200
commit12a86c49759f36c20dbd61317fd4bc2508eb30eb (patch)
treee0b755f961d8716b4c9591cc2b429ab3934ce8c3 /src
parent0b9435858b7bfc68b9a73d6b26eb6c8c5c0d7f13 (diff)
queue/PlaylistEdit: fix relative destination offset when moving a range
Commit 13208bf5a7c91a6406195139f1068f173ccdac94 added range support to the `move` command, but applied the wrong offset to the `to` variable. When the source range is before the current song, and the song thus gets decremented by the range size, then the final destination offset must also be decremented by the range size. Closes https://github.com/MusicPlayerDaemon/MPD/issues/663
Diffstat (limited to 'src')
-rw-r--r--src/queue/PlaylistEdit.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx
index a0e504f44..9a2b37eed 100644
--- a/src/queue/PlaylistEdit.cxx
+++ b/src/queue/PlaylistEdit.cxx
@@ -353,7 +353,7 @@ playlist::MoveRange(PlayerControl &pc, unsigned start, unsigned end, int to)
return;
to = (currentSong + abs(to)) % GetLength();
if (start < (unsigned)to)
- to--;
+ to -= end - start;
}
queue.MoveRange(start, end, to);