iliaa           Thu Feb  2 15:10:23 2006 UTC

  Modified files:              
    /php-src/ext/spl    spl_directory.c 
  Log:
  MFB51: Only use win32 directory separators on win32 or netware.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.68&r2=1.69&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.68 
php-src/ext/spl/spl_directory.c:1.69
--- php-src/ext/spl/spl_directory.c:1.68        Thu Feb  2 12:40:07 2006
+++ php-src/ext/spl/spl_directory.c     Thu Feb  2 15:10:23 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.68 2006/02/02 12:40:07 tony2001 Exp $ */
+/* $Id: spl_directory.c,v 1.69 2006/02/02 15:10:23 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -176,7 +176,11 @@
        intern->path_len = strlen(path);
        intern->u.dir.dirp = php_stream_opendir(path, 
ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
 
-       if (intern->path_len && (path[intern->path_len-1] == '/' || 
path[intern->path_len-1] == '\\')) {
+       if (intern->path_len && (path[intern->path_len-1] == '/'
+#if defined(PHP_WIN32) || defined(NETWARE)
+               || path[intern->path_len-1] == '\\'
+#endif
+       )) {
                intern->path = estrndup(path, --intern->path_len);
        } else {
                intern->path = estrndup(path, intern->path_len);
@@ -279,7 +283,11 @@
        intern->file_name_len = len;
 
        p1 = strrchr(path, '/');
+#if defined(PHP_WIN32) || defined(NETWARE)
        p2 = strrchr(path, '\\');
+#else
+       p2 = 0;
+#endif
        if (p1 || p2) {
                intern->path_len = (p1 > p2 ? p1 : p2) - path;
        } else {
@@ -1393,7 +1401,11 @@
        
        if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == 
SUCCESS) {
                p1 = strrchr(intern->file_name, '/');
-               p2 = strrchr(intern->file_name, '\\');
+#if defined(PHP_WIN32) || defined(NETWARE)
+               p2 = strrchr(path, '\\');
+#else
+               p2 = 0;
+#endif
                if (p1 || p2) {
                        intern->path_len = (p1 > p2 ? p1 : p2) - 
intern->file_name;
                } else {

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

Reply via email to