iliaa Thu Feb 2 15:10:04 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/ext/spl spl_directory.c Log: Only use win32 directory separators on win32 or netware. http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.15&r2=1.45.2.16&diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.45.2.15 php-src/ext/spl/spl_directory.c:1.45.2.16 --- php-src/ext/spl/spl_directory.c:1.45.2.15 Thu Feb 2 12:40:33 2006 +++ php-src/ext/spl/spl_directory.c Thu Feb 2 15:10:04 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.45.2.15 2006/02/02 12:40:33 tony2001 Exp $ */ +/* $Id: spl_directory.c,v 1.45.2.16 2006/02/02 15:10:04 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 { @@ -1397,7 +1405,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