diff options
author | Björn Stenberg <bjorn@haxx.se> | 2005-01-19 11:55:33 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2005-01-19 11:55:33 +0000 |
commit | f59a223266399577a70b60fd6816a2d479b1993a (patch) | |
tree | e6c61235dfa0cb914c97ba7d089e1c34653451d1 | |
parent | a58941d03a006e63906f44e95cd0f1222359aaf5 (diff) | |
download | rockbox-f59a223266399577a70b60fd6816a2d479b1993a.tar.gz rockbox-f59a223266399577a70b60fd6816a2d479b1993a.zip |
Strip trailing directory slash
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5604 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | tools/songdb.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/songdb.pl b/tools/songdb.pl index 3cc8814887..5d95ea5a87 100755 --- a/tools/songdb.pl +++ b/tools/songdb.pl @@ -59,6 +59,8 @@ if(! -d $dir or $help) { sub getdir { my ($dir) = @_; + $dir =~ s|/$|| if ($dir ne "/"); + if (opendir(DIR, $dir)) { # my @mp3 = grep { /\.mp3$/ && -f "$dir/$_" } readdir(DIR); my @all = readdir(DIR); @@ -83,6 +85,7 @@ sub extractmp3 { sub extractdirs { my ($dir, @files) = @_; + $dir =~ s|/$||; my @dirs; for(@files) { if( -d "$dir/$_" && ($_ !~ /^\.(|\.)$/)) { @@ -175,7 +178,7 @@ sub dodir { my @d = extractdirs($dir, @a); for $d (sort @d) { - #print "Subdir: $d\n"; + $dir =~ s|/$||; dodir("$dir/$d"); } } |