--- foxridge-archiver/MPIWGStor.pm 2006/02/10 17:01:18 1.6 +++ foxridge-archiver/MPIWGStor.pm 2006/06/12 17:01:39 1.7 @@ -155,15 +155,20 @@ sub split_file_path { # -# $name = sstrip($name) +# $name = sstrip($name, $slash) # # strips leading and trailing whitespace from $name +# replaces double slashes with single ones with $slash. # sub sstrip { - my ($name) = @_; + my ($name, $slash) = @_; if ($name =~ /^\s*(.*?)\s*$/) { - return $1; + $name = $1; + } + if ($slash) { + # trim multiple slashes + $name =~ s/\/+/\//g; } return $name; }