Commit 469c9b5d authored by Max Kellermann's avatar Max Kellermann

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.
parent e686d191
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment