aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-18 01:24:49 +0200
committerMax Kellermann <max@duempel.org>2009-10-18 01:24:49 +0200
commitd69e0ab53a4f856f2b20fd58ff7ae141984fecbd (patch)
treec8570861ea98fdf87255f1bda0f565c81c453e44 /src/command.c
parente7c267db4fb7d7e48b0dbdcfb39ef21724070033 (diff)
downloadmpd-d69e0ab53a4f856f2b20fd58ff7ae141984fecbd.tar.gz
mpd-d69e0ab53a4f856f2b20fd58ff7ae141984fecbd.tar.xz
mpd-d69e0ab53a4f856f2b20fd58ff7ae141984fecbd.zip
command: omitting the range end is possible
When the range end is missing, then the maximum possible value is assumed.
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index 2abdf47fa..38673f008 100644
--- a/src/command.c
+++ b/src/command.c
@@ -221,7 +221,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
if (*test == ':') {
value = strtol(++test, &test2, 10);
- if (*test2 != '\0' || test == test2) {
+ if (*test2 != '\0') {
va_list args;
va_start(args, fmt);
command_error_v(client, ACK_ERROR_ARG, fmt, args);
@@ -229,6 +229,9 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
return false;
}
+ if (test == test2)
+ value = G_MAXUINT;
+
if (value < 0) {
command_error(client, ACK_ERROR_ARG,
"Number is negative: %s", s);