diff options
author | Thomas Jansen <mithi@mithi.net> | 2008-12-29 16:37:41 +0100 |
---|---|---|
committer | Thomas Jansen <mithi@mithi.net> | 2008-12-29 16:37:41 +0100 |
commit | 0d8ba194beff2214791ffdbc11b4c088dceca514 (patch) | |
tree | 3e85e12e20a97e49505a9728fd983d8a24f8a3af | |
parent | a51fada1241fb6409cc9a7a9a050b79cceac8265 (diff) | |
download | mpd-0d8ba194beff2214791ffdbc11b4c088dceca514.tar.gz mpd-0d8ba194beff2214791ffdbc11b4c088dceca514.tar.xz mpd-0d8ba194beff2214791ffdbc11b4c088dceca514.zip |
tag_id3: strip leading and trailing whitespace from ID3 tags
Fix for bug #1491.
-rw-r--r-- | src/tag_id3.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tag_id3.c b/src/tag_id3.c index 83e7bac14..afeef6f15 100644 --- a/src/tag_id3.c +++ b/src/tag_id3.c @@ -40,7 +40,7 @@ */ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4, int type) { - id3_utf8_t *utf8; + id3_utf8_t *utf8, *utf8_stripped; id3_latin1_t *isostr; char *encoding; @@ -74,7 +74,11 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4, return NULL; } } - return utf8; + + utf8_stripped = (id3_utf8_t *)g_strdup(g_strstrip((gchar *)utf8)); + free(utf8); + + return utf8_stripped; } static struct tag *getID3Info( |