From 000e053ce73f6f87bc7c3797caceb1b60e467dcf Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 31 May 2004 11:42:46 +0000 Subject: icynames are now copied to title of streams git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/tag.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index 954019eea..2c58a3c16 100644 --- a/src/tag.c +++ b/src/tag.c @@ -158,11 +158,15 @@ MpdTag * newMpdTag() { return ret; } -void freeMpdTag(MpdTag * tag) { +void clearMpdTag(MpdTag * tag) { if(tag->artist) free(tag->artist); if(tag->album) free(tag->album); if(tag->title) free(tag->title); if(tag->track) free(tag->track); +} + +void freeMpdTag(MpdTag * tag) { + clearMpdTag(tag); free(tag); } @@ -171,10 +175,10 @@ MpdTag * mpdTagDup(MpdTag * tag) { if(tag) { ret = newMpdTag(); - ret->artist = strdup(tag->artist); - ret->album = strdup(tag->album); - ret->title = strdup(tag->title); - ret->track = strdup(tag->track); + if(tag->artist) ret->artist = strdup(tag->artist); + if(tag->album) ret->album = strdup(tag->album); + if(tag->title) ret->title = strdup(tag->title); + if(tag->track) ret->track = strdup(tag->track); ret->time = tag->time; } -- cgit v1.2.3