aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-01 09:28:03 +0200
committerMax Kellermann <max@duempel.org>2013-08-01 09:28:03 +0200
commit363050f44c9aa75b93a2402f0df2f1c5e97c35e9 (patch)
tree57c4ea9c5aa07d1186576e3a3854e55cf2925f95 /src
parentdbe04c4207387862db4c7c4484d3f356c4206e35 (diff)
downloadmpd-363050f44c9aa75b93a2402f0df2f1c5e97c35e9.tar.gz
mpd-363050f44c9aa75b93a2402f0df2f1c5e97c35e9.tar.xz
mpd-363050f44c9aa75b93a2402f0df2f1c5e97c35e9.zip
playlist_edit: fix "move" relative to current when there is no current song
Fixes Mantis #3770.
Diffstat (limited to 'src')
-rw-r--r--src/playlist_edit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/playlist_edit.c b/src/playlist_edit.c
index d10f49451..8042f2f76 100644
--- a/src/playlist_edit.c
+++ b/src/playlist_edit.c
@@ -396,7 +396,12 @@ playlist_move_range(struct playlist *playlist, struct player_control *pc,
? (int)queue_order_to_position(&playlist->queue,
playlist->current)
: -1;
- if (to < 0 && playlist->current >= 0) {
+ if (to < 0) {
+ if (currentSong < 0)
+ /* can't move relative to current song,
+ because there is no current song */
+ return PLAYLIST_RESULT_BAD_RANGE;
+
if (start <= (unsigned)currentSong && (unsigned)currentSong < end)
/* no-op, can't be moved to offset of itself */
return PLAYLIST_RESULT_SUCCESS;