Fix indenting and formatting

This commit is contained in:
Chris Morgan
2006-06-22 22:34:56 +00:00
committed by WineHQ
parent eea66ec98c
commit 58b267506f

View File

@@ -735,8 +735,9 @@ function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkur
echo "<a href='".$linkurl."&page=$nextPage'>&gt</a> ";
echo "<a href='".$linkurl."&page=$totalPages'>&gt|</a> ";
} else
{
echo "&gt &gt|";
}
}
// Expand a path like /something/somedirectory/../ to /something
@@ -744,13 +745,16 @@ function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkur
function SimplifyPath($path) {
$dirs = explode('/',$path);
for($i=0; $i<count($dirs);$i++) {
if($dirs[$i]=="." || $dirs[$i]=="") {
for($i=0; $i<count($dirs);$i++)
{
if($dirs[$i]=="." || $dirs[$i]=="")
{
array_splice($dirs,$i,1);
$i--;
}
if($dirs[$i]=="..") {
if($dirs[$i]=="..")
{
$cnt = count($dirs);
$dirs=Simplify($dirs, $i);
$i-= $cnt-count($dirs);
@@ -759,7 +763,8 @@ function SimplifyPath($path) {
return implode('/',$dirs);
}
function Simplify($dirs, $idx) {
function Simplify($dirs, $idx)
{
if($idx==0) return $dirs;
if($dirs[$idx-1]=="..") Simplify($dirs, $idx-1);