Strip trailing directory slash

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5604 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2005-01-19 11:55:33 +00:00
parent a58941d03a
commit f59a223266

View file

@ -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");
}
}