Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d69e0ab5
Commit
d69e0ab5
authored
Oct 18, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: omitting the range end is possible
When the range end is missing, then the maximum possible value is assumed.
parent
e7c267db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+14
-0
command.c
src/command.c
+4
-1
No files found.
NEWS
View file @
d69e0ab5
...
...
@@ -9,6 +9,7 @@ ver 0.16 (20??/??/??)
- "addid" with negative position is deprecated
- "load" supports remote playlists (m3u, pls, xspf, lastfm://)
- allow changing replay gain mode on-the-fly
- omitting the range end is possible
* input:
- lastfm: obsolete plugin removed
* tags:
...
...
doc/protocol.xml
View file @
d69e0ab5
...
...
@@ -67,6 +67,20 @@
successful command executed in the command list.
</para>
</section>
<section>
<title>
Ranges
</title>
<para>
Some commands (e.g.
<link
linkend=
"command_delete"
><command>
delete
</command></link>
)
allow specifying a range in the form
<parameter>
START:END
</parameter>
(the
<varname>
END
</varname>
item is not included in the range, similar to ranges in the
Python programming language). If
<varname>
END
</varname>
is
omitted, then the maximum possible value is assumed.
</para>
</section>
</chapter>
<chapter>
...
...
src/command.c
View file @
d69e0ab5
...
...
@@ -221,7 +221,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
if
(
*
test
==
':'
)
{
value
=
strtol
(
++
test
,
&
test2
,
10
);
if
(
*
test2
!=
'\0'
||
test
==
test2
)
{
if
(
*
test2
!=
'\0'
)
{
va_list
args
;
va_start
(
args
,
fmt
);
command_error_v
(
client
,
ACK_ERROR_ARG
,
fmt
,
args
);
...
...
@@ -229,6 +229,9 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
return
false
;
}
if
(
test
==
test2
)
value
=
G_MAXUINT
;
if
(
value
<
0
)
{
command_error
(
client
,
ACK_ERROR_ARG
,
"Number is negative: %s"
,
s
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment