From b75786a2f5c0031a08920656226c4b489967acf9 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Tue, 28 Jan 2003 06:19:52 +0000 Subject: [PATCH] Fixed small navigation bug in CGI Action_Browse for top-level directory. --- cgi-bin/BackupPC_Admin | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 2.20.1