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.
This commit is contained in:
parent
45598d50e3
commit
1452717459
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user