From 59fdfd25cbfc82cd5bad92d26b9d904b8f81014b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Mar 2019 19:50:09 +0100 Subject: [PATCH] command/database: fix "list" with filter expression Disable the 0.11 compatibility mode if the only argument is a filter expression. Closes https://github.com/MusicPlayerDaemon/MPD/issues/506 --- NEWS | 1 + src/command/DatabaseCommands.cxx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 59e60e159..86f6d682e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.6 (not yet released) * protocol - allow loading playlists specified as absolute filesystem paths + - fix "list" with filter expression * input - cdio_paranoia: fix build failure due to missing #include * playlist diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index 907e2e6fb..6fc9fa8ac 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -268,7 +268,10 @@ handle_list(Client &client, Request args, Response &r) std::unique_ptr filter; TagType group = TAG_NUM_OF_ITEM_TYPES; - if (args.size == 1) { + if (args.size == 1 && + /* parantheses are the syntax for filter expressions: no + compatibility mode */ + args.front()[0] != '(') { /* for compatibility with < 0.12.0 */ if (tagType != TAG_ALBUM) { r.FormatError(ACK_ERROR_ARG,