iliaa           Sun Dec  3 15:52:17 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/main       php_scandir.c 
  Log:
  Fixed php_readdir_r() usage in scandir emulation
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_scandir.c?r1=1.12.2.1.2.3&r2=1.12.2.1.2.4&diff_format=u
Index: php-src/main/php_scandir.c
diff -u php-src/main/php_scandir.c:1.12.2.1.2.3 
php-src/main/php_scandir.c:1.12.2.1.2.4
--- php-src/main/php_scandir.c:1.12.2.1.2.3     Sun Dec  3 14:37:32 2006
+++ php-src/main/php_scandir.c  Sun Dec  3 15:52:17 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_scandir.c,v 1.12.2.1.2.3 2006/12/03 14:37:32 tony2001 Exp $ */
+/* $Id: php_scandir.c,v 1.12.2.1.2.4 2006/12/03 15:52:17 iliaa Exp $ */
 
 #include "php.h"
 #include "php_scandir.h"
@@ -61,11 +61,10 @@
 {
        DIR *dirp = NULL;
        struct dirent **vector = NULL;
-       struct dirent *dp = NULL;
        int vector_size = 0;
        int nfiles = 0;
        char entry[sizeof(struct dirent)+MAXPATHLEN];
-       struct dirent *result = (struct dirent *)&entry;
+       struct dirent *dp = (struct dirent *)&entry;
 
        if (namelist == NULL) {
                return -1;
@@ -75,7 +74,7 @@
                return -1;
        }
 
-       while ((dp = php_readdir_r(dirp, (struct dirent *)entry, &result)) == 0 
&& result) {
+       while (!php_readdir_r(dirp, (struct dirent *)entry, &dp) && dp) {
                int dsize = 0;
                struct dirent *newdp = NULL;
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to