Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/4981258 to your computer and use it in GitHub Desktop.
Save Mic92/4981258 to your computer and use it in GitHub Desktop.
From 4437f3f80c3d168b626cd9ae1666aaef0ff378b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@higgsboson.tk>
Date: Mon, 18 Feb 2013 22:57:39 +0100
Subject: [PATCH] command: allow to omit END in ranges (START:END)
If END is omitted, mpd should use the highest possible value instead of raising an error.
This partially reverts 52e9cab1c1743f64a7
---
src/protocol/ArgParser.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx
index 0ab19f7..6bd53a3 100644
--- a/src/protocol/ArgParser.cxx
+++ b/src/protocol/ArgParser.cxx
@@ -103,7 +103,7 @@ check_range(Client *client, unsigned *value_r1, unsigned *value_r2,
if (*test == ':') {
value = strtol(++test, &test2, 10);
- if (test2 == test || *test2 != '\0') {
+ if (*test2 != '\0') {
command_error(client, ACK_ERROR_ARG,
"Integer or range expected: %s", s);
return false;
--
1.8.1.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment