diff options
author | Max Kellermann <max@duempel.org> | 2009-01-11 17:11:11 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-11 17:11:11 +0100 |
commit | 983822ea525f0d48c8329513c846fe183bd0353f (patch) | |
tree | 777b60c567a8f8fa3f8931ba4aa2da9a7386c076 /src | |
parent | e33cd80f256cc1c8541ac491eaedde93bb901d86 (diff) | |
download | mpd-983822ea525f0d48c8329513c846fe183bd0353f.tar.gz mpd-983822ea525f0d48c8329513c846fe183bd0353f.tar.xz mpd-983822ea525f0d48c8329513c846fe183bd0353f.zip |
command: restore the "playlistinfo -1" behavior
If a range is "-1", display the whole list. This behavior is
undocumented, but some clients rely on it.
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c index 646f76bf5..1fac4fd0e 100644 --- a/src/command.c +++ b/src/command.c @@ -177,6 +177,14 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2, return false; } + if (value == -1 && *test == 0) { + /* compatibility with older MPD versions: specifying + "-1" makes MPD display the whole list */ + *value_r1 = 0; + *value_r2 = UINT_MAX; + return true; + } + if (value < 0) { command_error(client, ACK_ERROR_ARG, "Number is negative: %s", s); |