diff options
author | Max Kellermann <max@duempel.org> | 2013-08-04 14:36:22 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-04 14:36:22 +0200 |
commit | 9326ce53ecd225269147109d87af763fc3846ddf (patch) | |
tree | 510b468db4f9007502516c1bf7dc8db65c655da6 /src/PlaylistEdit.cxx | |
parent | fcb7233b25f21c15e132a9c0e0de5ab5b4f492c7 (diff) | |
parent | d8217c364a182a12fb8abd19732341af1515ffb0 (diff) | |
download | mpd-9326ce53ecd225269147109d87af763fc3846ddf.tar.gz mpd-9326ce53ecd225269147109d87af763fc3846ddf.tar.xz mpd-9326ce53ecd225269147109d87af763fc3846ddf.zip |
Merge tag 'release-0.17.5'
Diffstat (limited to 'src/PlaylistEdit.cxx')
-rw-r--r-- | src/PlaylistEdit.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/PlaylistEdit.cxx b/src/PlaylistEdit.cxx index e3d3eac25..0d46f66aa 100644 --- a/src/PlaylistEdit.cxx +++ b/src/PlaylistEdit.cxx @@ -342,7 +342,12 @@ playlist::MoveRange(player_control &pc, unsigned start, unsigned end, int to) * (-playlist.length == to) => move to position BEFORE current song */ const int currentSong = GetCurrentPosition(); - if (to < 0 && currentSong >= 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; |