]> diplodocus.org Git - flac-archive/commitdiff
(flac): Copy filename sanitization from flac2mp3.
authorepg <>
Tue, 31 Aug 2004 04:27:40 +0000 (04:27 +0000)
committerepg <>
Tue, 31 Aug 2004 04:27:40 +0000 (04:27 +0000)
fa-flacd

index c3413e543af21f6568fd3977de14362074344d4d..e2a2b2189b60e6fcf28d7d5dacd36e12cd3da6d7 100755 (executable)
--- a/fa-flacd
+++ b/fa-flacd
@@ -70,6 +70,7 @@ sub flac {
     my $artist;
     my $album;
     my @tags;
     my $artist;
     my $album;
     my @tags;
+    my $outfile;
     my $status;
 
     verbose("Renaming $dir/tags\n");
     my $status;
 
     verbose("Renaming $dir/tags\n");
@@ -84,8 +85,16 @@ sub flac {
     verbose("chdir($dir)\n");
     chdir($dir) or die("chdir($dir): $!");
 
     verbose("chdir($dir)\n");
     chdir($dir) or die("chdir($dir): $!");
 
+    $outfile = "$album.flac-tmp";
+    for ($outfile) {
+        s/\//_/g;
+        s/:/_/g;
+        s/'/_/g;
+        s/"/_/g;
+    }
+
     verbose("Running flac\n");
     verbose("Running flac\n");
-    $status = system('flac', '-o', "../$artist/$album.flac-tmp",
+    $status = system('flac', '-o', "../$artist/$outfile",
                      '--delete-input-file', '-V', '--cuesheet',
                      'cue', '--no-padding', '--best',
                      map({ ('-T', $_) } @tags),
                      '--delete-input-file', '-V', '--cuesheet',
                      'cue', '--no-padding', '--best',
                      map({ ('-T', $_) } @tags),