diff --git a/utils/themeeditor/addresourcedir.php b/utils/themeeditor/addresourcedir.php index 3c2ac33f04..cd34433077 100755 --- a/utils/themeeditor/addresourcedir.php +++ b/utils/themeeditor/addresourcedir.php @@ -25,11 +25,10 @@ if($argc < 2) $path = getcwd(); else $path = $argv[1]; -if($path[count($path) - 1] != '/') - $path = $path . '/'; +$path = rtrim($path, "/"); $dir = dir($path); $split = explode("/", $path); -$last = $split[count($split) - 2]; +$last = $split[count($split) - 1]; echo "\t\n"; while(false !== ($entry = $dir->read())) { @@ -37,7 +36,7 @@ while(false !== ($entry = $dir->read())) continue; echo "\t\t"; echo ""; - echo $path . $entry . ""; + echo $path . '/' . $entry . ""; echo "\n"; } echo "\t\n";