aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-03-12 17:58:16 +0100
committerMax Kellermann <max@duempel.org>2010-03-12 17:58:16 +0100
commit469c9b5def450dbc50a71077df75f239cee7f4fa (patch)
tree686210256056380fb712277a54e80987e91f8464 /src/command.c
parente686d19154d8de8f9884cd768ef5e600991076ef (diff)
downloadmpd-469c9b5def450dbc50a71077df75f239cee7f4fa.tar.gz
mpd-469c9b5def450dbc50a71077df75f239cee7f4fa.tar.xz
mpd-469c9b5def450dbc50a71077df75f239cee7f4fa.zip
command: allow "update" with slash or empty path
When handle_update() was modified to use uri_safe_local(), suddently "mpc update ''" and "mpc update '/'" stopped working, because both are not a "safe" local URI. This patch adds a special case for these, to retain backwards compatibility.
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 ab1a7b0a9..a7fccbed4 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1058,7 +1058,10 @@ handle_update(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
if (argc == 2) {
path = argv[1];
- if (!uri_safe_local(path)) {
+ if (*path == 0 || strcmp(path, "/") == 0)
+ /* backwards compatibility with MPD 0.15 */
+ path = NULL;
+ else if (!uri_safe_local(path)) {
command_error(client, ACK_ERROR_ARG,
"Malformed path");
return COMMAND_RETURN_ERROR;