Commit 14527174 authored by Max Kellermann's avatar Max Kellermann

song_save: check for colon and space when loading a tag

matchesAnMpdTagItemKey() broke when two tag items had the same prefix, because it did not check if the tag name ended after the prefix. Add a check for the colon and the space after the tag name.
parent 45598d50
......@@ -91,8 +91,10 @@ static int matchesAnMpdTagItemKey(char *buffer, int *itemType)
int i;
for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
if (0 == strncmp(mpdTagItemKeys[i], buffer,
strlen(mpdTagItemKeys[i]))) {
size_t len = strlen(mpdTagItemKeys[i]);
if (0 == strncmp(mpdTagItemKeys[i], buffer, len) &&
buffer[len] == ':' && buffer[len + 1] == ' ') {
*itemType = i;
return 1;
}
......
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