aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/QueueCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-18 21:26:31 +0100
committerMax Kellermann <max@duempel.org>2014-11-18 21:31:54 +0100
commit460cfba6ff76ed58e6f6778cfeb9dd424d7fe75a (patch)
treedd1bcade0dc55709cf2b4c75e33729e11fbd65c0 /src/command/QueueCommands.cxx
parent7c6b991de7824d79dc3d71587db8139c485deb86 (diff)
downloadmpd-460cfba6ff76ed58e6f6778cfeb9dd424d7fe75a.tar.gz
mpd-460cfba6ff76ed58e6f6778cfeb9dd424d7fe75a.tar.xz
mpd-460cfba6ff76ed58e6f6778cfeb9dd424d7fe75a.zip
QueueCommands: workaround for buggy clients that send "add /"
Diffstat (limited to 'src/command/QueueCommands.cxx')
-rw-r--r--src/command/QueueCommands.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx
index 36c8ac84f..d0b789eb1 100644
--- a/src/command/QueueCommands.cxx
+++ b/src/command/QueueCommands.cxx
@@ -61,7 +61,16 @@ translate_uri(Client &client, const char *uri)
CommandResult
handle_add(Client &client, gcc_unused unsigned argc, char *argv[])
{
- const char *const uri = translate_uri(client, argv[1]);
+ const char *uri = argv[1];
+ if (memcmp(uri, "/", 2) == 0)
+ /* this URI is malformed, but some clients are buggy
+ and use "add /" to add the whole database, which
+ was never intended to work, but once did; in order
+ to retain backwards compatibility, work around this
+ here */
+ uri = "";
+
+ uri = translate_uri(client, uri);
if (uri == nullptr)
return CommandResult::ERROR;