[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/www/scm controller.php,1.2,1.3
From: |
cbayle |
Subject: |
[Gforge-commits] gforge/www/scm controller.php,1.2,1.3 |
Date: |
Fri, 09 Jan 2004 17:26:19 -0600 |
Update of /cvsroot/gforge/gforge/www/scm
In directory db.perdue.net:/tmp/cvs-serv20639
Modified Files:
controller.php
Log Message:
Patch [ #620 ]
Just two little fixes :
* only closedir when opendir is OK (there was an error if the directory didn't
exist)
* it's far better to initialize arrays.
by Guillaume Smet
Index: controller.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/scm/controller.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- controller.php 23 Jun 2003 20:46:45 -0000 1.2
+++ controller.php 9 Jan 2004 23:26:17 -0000 1.3
@@ -136,13 +136,14 @@
* @return an array of dirs/files/
*/
function retrieveDir($rootdirpath) {
+ $array = array();
if($dir = @opendir($rootdirpath)) {
$array[] = $rootdirpath;
while(($file = readdir($dir)) !== false) {
$array[] = $rootdirpath."/".$file;
}
+ closedir($dir);
}
- closedir($dir);
return $array;
}
@@ -221,6 +222,7 @@
* @return an array of files
*/
function retrieveDirs($rootdirpath) {
+ $array = array();
if ($dir = @opendir($rootdirpath)) {
$array[] = $rootdirpath;
while (($file = readdir($dir)) !== false) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/www/scm controller.php,1.2,1.3,
cbayle <=