From: cbarratt Date: Tue, 28 Jan 2003 06:19:52 +0000 (+0000) Subject: Fixed small navigation bug in CGI Action_Browse for top-level directory. X-Git-Tag: v2_0_0beta0~11 X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=b75786a2f5c0031a08920656226c4b489967acf9 Fixed small navigation bug in CGI Action_Browse for top-level directory. --- diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index 99cc594..85d8807 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -603,10 +603,10 @@ sub Action_Browse my($dirOpen, $gotDir, $imgStr, $img); my $fURI = $f; # URI escaped $f my $shareURI = $share; # URI escaped $share - my $path = "$relDir/$f"; + (my $path = "$relDir/$f") =~ s{//+}{/}g; if ( $shareURI eq "" ) { $shareURI = $path; - $path = ""; + $path = "/"; } $path =~ s{^/+}{/}; $path =~ s/([^\w.\/-])/uc sprintf("%%%02x", ord($1))/eg; @@ -713,9 +713,10 @@ EOF # Prune the last directory off $relDir, or at the very end # do the top-level directory. # - if ( $relDir eq "" ) { + if ( $relDir eq "" || $relDir eq "/" ) { $currDir = $share; $share = ""; + $relDir = ""; } else { $relDir =~ s/(.*)\/(.*)/$1/; $currDir = $2;