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
c45f1138
Commit
c45f1138
authored
Mar 11, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/xspf: concatenate multiple CharacterData fragments
Closes
https://github.com/MusicPlayerDaemon/MPD/issues/781
parent
e0a8fd39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
NEWS
NEWS
+2
-0
XspfPlaylistPlugin.cxx
src/playlist/plugins/XspfPlaylistPlugin.cxx
+15
-6
No files found.
NEWS
View file @
c45f1138
ver 0.21.21 (not yet released)
* configuration
- fix bug in "metadata_to_use" setting
* playlist
- xspf: fix corrupt tags in the presence of XML entities
* archive
- iso9660: skip empty file names to work around libcdio bug
* decoder
...
...
src/playlist/plugins/XspfPlaylistPlugin.cxx
View file @
c45f1138
...
...
@@ -61,6 +61,8 @@ struct XspfParser {
std
::
string
location
;
TagBuilder
tag_builder
;
std
::
string
value
;
};
static
constexpr
struct
tag_table
xspf_tag_elements
[]
=
{
...
...
@@ -81,6 +83,7 @@ xspf_start_element(void *user_data, const XML_Char *element_name,
gcc_unused
const
XML_Char
**
atts
)
{
XspfParser
*
parser
=
(
XspfParser
*
)
user_data
;
parser
->
value
.
clear
();
switch
(
parser
->
state
)
{
case
XspfParser
:
:
ROOT
:
...
...
@@ -154,10 +157,21 @@ xspf_end_element(void *user_data, const XML_Char *element_name)
break
;
case
XspfParser
:
:
TAG
:
if
(
!
parser
->
value
.
empty
())
parser
->
tag_builder
.
AddItem
(
parser
->
tag_type
,
StringView
(
parser
->
value
.
data
(),
parser
->
value
.
length
()));
parser
->
state
=
XspfParser
::
TRACK
;
break
;
case
XspfParser
:
:
LOCATION
:
parser
->
location
=
std
::
move
(
parser
->
value
);
parser
->
state
=
XspfParser
::
TRACK
;
break
;
}
parser
->
value
.
clear
();
}
static
void
XMLCALL
...
...
@@ -173,13 +187,8 @@ xspf_char_data(void *user_data, const XML_Char *s, int len)
break
;
case
XspfParser
:
:
TAG
:
parser
->
tag_builder
.
AddItem
(
parser
->
tag_type
,
StringView
(
s
,
len
));
break
;
case
XspfParser
:
:
LOCATION
:
parser
->
location
.
assign
(
s
,
len
);
parser
->
value
.
append
(
s
,
len
);
break
;
}
}
...
...
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