Commit 614a0118 authored by Courtney Cavin's avatar Courtney Cavin

input/lastfm: Ensure multiple identical xml entities are decoded.

Previously, if two identical entities appeared in one string, only the first would get decoded. This fixes that bug.
parent 0c66832b
......@@ -175,13 +175,12 @@ lastfm_xmldecode(const char *value)
unsigned int i;
for (i = 0; i < sizeof(entities)/sizeof(entities[0]); ++i) {
char *p;
int slen = strlen(entities[i].text);
char *p = strstr(txt, entities[i].text);
if (p == NULL)
continue;
*p = entities[i].repl;
g_strlcpy(p + 1, p + slen, strlen(p) - slen);
while ((p = strstr(txt, entities[i].text))) {
*p = entities[i].repl;
g_strlcpy(p + 1, p + slen, strlen(p) - slen);
}
}
return txt;
}
......
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