aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/DatabaseCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-08-11 21:35:52 +0200
committerMax Kellermann <max@duempel.org>2015-08-11 22:43:10 +0200
commitcbdc3194cc20aa5abcce8b53c44d46a96002ad3a (patch)
tree04164bedb2ca82200ebcb4f4a01f658a4f79b016 /src/command/DatabaseCommands.cxx
parent993df0fd289d4426c633fd6e6d12bffe6061599d (diff)
downloadmpd-cbdc3194cc20aa5abcce8b53c44d46a96002ad3a.tar.gz
mpd-cbdc3194cc20aa5abcce8b53c44d46a96002ad3a.tar.xz
mpd-cbdc3194cc20aa5abcce8b53c44d46a96002ad3a.zip
protocol/ArgParser: add struct RangeArg
Diffstat (limited to 'src/command/DatabaseCommands.cxx')
-rw-r--r--src/command/DatabaseCommands.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx
index 66ca2c279..8999fb1ea 100644
--- a/src/command/DatabaseCommands.cxx
+++ b/src/command/DatabaseCommands.cxx
@@ -67,15 +67,15 @@ handle_lsinfo2(Client &client, ConstBuffer<const char *> args)
static CommandResult
handle_match(Client &client, ConstBuffer<const char *> args, bool fold_case)
{
- unsigned window_start = 0, window_end = std::numeric_limits<int>::max();
+ RangeArg window;
if (args.size >= 2 && strcmp(args[args.size - 2], "window") == 0) {
- if (!check_range(client, &window_start, &window_end,
- args.back()))
+ if (!ParseCommandArg(client, window, args.back()))
return CommandResult::ERROR;
args.pop_back();
args.pop_back();
- }
+ } else
+ window.SetAll();
SongFilter filter;
if (!filter.Parse(args, fold_case)) {
@@ -87,7 +87,7 @@ handle_match(Client &client, ConstBuffer<const char *> args, bool fold_case)
Error error;
return db_selection_print(client, selection, true, false,
- window_start, window_end, error)
+ window.start, window.end, error)
? CommandResult::OK
: print_error(client, error);
}