From f64e458729e02cf266b1e0eb90233b2196133aef Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 12 May 2009 01:15:01 +0000 Subject: [PATCH] * Don't store empty metadata values. --- tagutils/tagutils-misc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tagutils/tagutils-misc.c b/tagutils/tagutils-misc.c index 5001421..0598e2b 100644 --- a/tagutils/tagutils-misc.c +++ b/tagutils/tagutils-misc.c @@ -199,7 +199,8 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length) } else if(!strncasecmp(strbuf, "ARTIST=", 7)) { - psong->contributor[ROLE_ARTIST] = strdup(strbuf + 7); + if( *(strbuf+7) ) + psong->contributor[ROLE_ARTIST] = strdup(strbuf + 7); } else if(!strncasecmp(strbuf, "ARTISTSORT=", 11)) { @@ -207,7 +208,8 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length) } else if(!strncasecmp(strbuf, "TITLE=", 6)) { - psong->title = strdup(strbuf + 6); + if( *(strbuf+6) ) + psong->title = strdup(strbuf + 6); } else if(!strncasecmp(strbuf, "TRACKNUMBER=", 12)) { @@ -219,7 +221,8 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length) } else if(!strncasecmp(strbuf, "GENRE=", 6)) { - psong->genre = strdup(strbuf + 6); + if( *(strbuf+6) ) + psong->genre = strdup(strbuf + 6); } else if(!strncasecmp(strbuf, "DATE=", 5)) { @@ -241,7 +244,8 @@ vc_scan(struct song_metadata *psong, const char *comment, const size_t length) } else if(!strncasecmp(strbuf, "COMMENT=", 8)) { - psong->comment = strdup(strbuf + 8); + if( *(strbuf+8) ) + psong->comment = strdup(strbuf + 8); } else if(!strncasecmp(strbuf, "MUSICBRAINZ_ALBUMID=", 20)) {