strip traling slash for dirs in _export_path
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jun 2010 14:52:19 +0000 (16:52 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jun 2010 14:52:19 +0000 (16:52 +0200)
lib/MojoFacets/Data.pm

index 3681e0f..3af006c 100644 (file)
@@ -343,7 +343,9 @@ sub _export_path {
        my $dir = $self->app->home->rel_dir('public') . "/export/$path";
        mkpath $dir unless -e $dir;
        my $name = join('.', map { __unac($_) } @_ );
-       $dir . '/' . $name;
+       my $full = $dir . '/' . $name;
+       $full =~ s/\/+$// if -d $full; # strip trailing slash for dirs
+       return $full;
 }
 
 sub columns {