aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-31 11:42:46 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-31 11:42:46 +0000
commit000e053ce73f6f87bc7c3797caceb1b60e467dcf (patch)
tree2411ee50bcd20c53cb8ed6f82bfb76ee5227d77b /src/tag.c
parentb4a91d574fb3ad8ffdacab792a46cc668010c7d6 (diff)
downloadmpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.tar.gz
mpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.tar.xz
mpd-000e053ce73f6f87bc7c3797caceb1b60e467dcf.zip
icynames are now copied to title of streams
git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c14
1 files changed, 9 insertions, 5 deletions
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;
}