aboutsummaryrefslogtreecommitdiffstats
path: root/src/cue
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-03-17 23:12:21 +0100
committerMax Kellermann <max@duempel.org>2010-03-17 23:12:21 +0100
commit2e72a9b262ac71a8a7e8ed9b00efa80597d5f17d (patch)
tree1d053e0828b76946b23a57d683dff4b157debae6 /src/cue
parent96033e4b4e9ed599d8663a4d2d5a9dd586957bab (diff)
downloadmpd-2e72a9b262ac71a8a7e8ed9b00efa80597d5f17d.tar.gz
mpd-2e72a9b262ac71a8a7e8ed9b00efa80597d5f17d.tar.xz
mpd-2e72a9b262ac71a8a7e8ed9b00efa80597d5f17d.zip
tag: added function tag_merge_replace()
Like tag_merge(), but can deal with NULL parameters, and frees both tag objects.
Diffstat (limited to 'src/cue')
-rw-r--r--src/cue/cue_tag.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/cue/cue_tag.c b/src/cue/cue_tag.c
index ce8202a81..6251b03e2 100644
--- a/src/cue/cue_tag.c
+++ b/src/cue/cue_tag.c
@@ -173,7 +173,6 @@ cue_tag_file( FILE* fp,
{
struct tag* cd_tag = NULL;
struct tag* track_tag = NULL;
- struct tag* merge_tag = NULL;
struct Cd* cd = NULL;
if (tnum > 256)
@@ -199,26 +198,7 @@ cue_tag_file( FILE* fp,
cd_delete(cd);
}
- if ((cd_tag != NULL) && (track_tag != NULL))
- {
- merge_tag = tag_merge(cd_tag, track_tag);
- tag_free(cd_tag);
- tag_free(track_tag);
- return merge_tag;
- }
-
- else if (cd_tag != NULL)
- {
- return cd_tag;
- }
-
- else if (track_tag != NULL)
- {
- return track_tag;
- }
-
- else
- return NULL;
+ return tag_merge_replace(cd_tag, track_tag);
}
struct tag*