aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_save.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-14 13:44:14 +0100
committerMax Kellermann <max@duempel.org>2009-01-14 13:44:14 +0100
commit642b861526084658a7b10beb9cbb81000d23432d (patch)
treee6ae8e71ce584955a2b1b35fe753a87adfc582dd /src/song_save.c
parent3c6a85d8f7f68b5f85eca0c7f8363ae520154bd0 (diff)
downloadmpd-642b861526084658a7b10beb9cbb81000d23432d.tar.gz
mpd-642b861526084658a7b10beb9cbb81000d23432d.tar.xz
mpd-642b861526084658a7b10beb9cbb81000d23432d.zip
song_save: don't fail on empty tag values
If a tag value is an empty string, the space after the colon was removed by g_strchomp(). Fix this by removing the space check and using g_strchug() on the return value.
Diffstat (limited to '')
-rw-r--r--src/song_save.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/song_save.c b/src/song_save.c
index eecdd7634..8011a32fb 100644
--- a/src/song_save.c
+++ b/src/song_save.c
@@ -95,9 +95,9 @@ matchesAnMpdTagItemKey(char *buffer, enum tag_type *itemType)
size_t len = strlen(mpdTagItemKeys[i]);
if (0 == strncmp(mpdTagItemKeys[i], buffer, len) &&
- buffer[len] == ':' && buffer[len + 1] == ' ') {
+ buffer[len] == ':') {
*itemType = i;
- return buffer + len + 2;
+ return g_strchug(buffer + len + 1);
}
}