summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2012-08-22 12:06:29 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2012-09-06 19:58:38 +0200
commit28f0cc5814a8630c2eca51c0b655f0bcc9260dde (patch)
treeda77da6118a7b0d41f372f60aca580655b69b37c
parentb47b716da8eafb2e28d1a416b00fdbc17d40bfff (diff)
Sanitize disc number if required
When the file name is set to 'Disc d - t ...' it should be sanitized in case the user has requested the removal of spaces from the file name. https://bugzilla.gnome.org/show_bug.cgi?id=661646
-rw-r--r--src/sj-extracting.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sj-extracting.c b/src/sj-extracting.c
index 77871d5..820e35c 100644
--- a/src/sj-extracting.c
+++ b/src/sj-extracting.c
@@ -1160,7 +1160,9 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track)
case 'n':
/* Disc and track number */
if (track->album->disc_number > 0) {
- string = g_strdup_printf ("Disc %d - %d", track->album->disc_number, track->number);
+ char *s = g_strdup_printf ("Disc %d - %d", track->album->disc_number, track->number);
+ string = sanitize_path (s, filesystem_type); /* strip spaces if required */
+ g_free (s);
} else {
string = g_strdup_printf ("%d", track->number);
}