helly           Mon Feb 19 20:32:39 2007 UTC

  Modified files:              
    /php-src/ext/spl    spl_directory.c 
  Log:
  - Bugfix #40546: SplFileInfo::getPathInfo() throws an execption if directory 
is in root dir.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.117&r2=1.118&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.117 
php-src/ext/spl/spl_directory.c:1.118
--- php-src/ext/spl/spl_directory.c:1.117       Sat Jan 20 16:19:20 2007
+++ php-src/ext/spl/spl_directory.c     Mon Feb 19 20:32:39 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.117 2007/01/20 16:19:20 helly Exp $ */
+/* $Id: spl_directory.c,v 1.118 2007/02/19 20:32:39 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -334,11 +334,21 @@
        zval *arg1;
        
        if (!file_path.v || !file_path_len) {
+#if defined(PHP_WIN32)
                zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, 
"Cannot create SplFileInfo for empty path");
                if (file_path.v && !use_copy)
                {
                        efree(file_path.v);
                }
+#else
+               if (file_path.v && !use_copy) {
+                       efree(file_path.v);
+               }
+               use_copy = 1;
+               file_path_len = 1;
+               file_path.s = "/";
+               file_type = IS_STRING;
+#endif
                return NULL;
        }
 

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

Reply via email to