From 642b861526084658a7b10beb9cbb81000d23432d Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Wed, 14 Jan 2009 13:44:14 +0100
Subject: 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.
---
 src/song_save.c | 4 ++--
 1 file 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);
 		}
 	}
 
-- 
cgit v1.2.3