helly           Fri Jan 19 00:36:11 2007 UTC

  Modified files:              
    /php-src/ext/spl    spl_directory.c 
    /php-src/ext/spl/tests      bug36258.phpt bug36287.phpt 
  Log:
  - A few unicode fixes and tidying
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.114&r2=1.115&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.114 
php-src/ext/spl/spl_directory.c:1.115
--- php-src/ext/spl/spl_directory.c:1.114       Thu Jan 18 22:52:32 2007
+++ php-src/ext/spl/spl_directory.c     Fri Jan 19 00:36:11 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.114 2007/01/18 22:52:32 tony2001 Exp $ */
+/* $Id: spl_directory.c,v 1.115 2007/01/19 00:36:11 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -157,7 +157,7 @@
 
 static inline void spl_filesystem_object_get_file_name(spl_filesystem_object 
*intern TSRMLS_DC) /* {{{ */
 {
-       if (!intern->file_name.s) {
+       if (!intern->file_name.v) {
                switch (intern->type) {
                case SPL_FS_INFO:
                case SPL_FS_FILE:
@@ -862,18 +862,18 @@
        spl_filesystem_object *intern;
        zstr path;
        zend_uchar path_type;
-       int len;
+       int path_len;
        long flags = SPL_FILE_DIR_CURRENT_AS_FILEINFO;
 
        php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException 
TSRMLS_CC);
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &path, 
&len, &path_type, &flags) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|l", &path, 
&path_len, &path_type, &flags) == FAILURE) {
                php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                return;
        }
 
        intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
-       spl_filesystem_dir_open(intern, path_type, path, len TSRMLS_CC);
+       spl_filesystem_dir_open(intern, path_type, path, path_len TSRMLS_CC);
        intern->u.dir.is_recursive = instanceof_function(intern->std.ce, 
spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0;
        intern->flags = flags;
 
@@ -926,16 +926,16 @@
        spl_filesystem_object *intern = 
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
        
        if (!strcmp(intern->u.dir.entry.d_name, ".") || 
!strcmp(intern->u.dir.entry.d_name, "..")) {
-               RETURN_BOOL(0);
+               RETURN_FALSE;
        } else {
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", 
&allow_links) == FAILURE) {
                        return;
                }
                spl_filesystem_object_get_file_name(intern TSRMLS_CC);
                if (!allow_links) {
-                       php_u_stat(intern->file_name_len, intern->file_name, 
intern->file_name_len, FS_IS_LINK, FG(default_context), return_value TSRMLS_CC);
+                       php_u_stat(intern->file_name_type, intern->file_name, 
intern->file_name_len, FS_IS_LINK, FG(default_context), return_value TSRMLS_CC);
                        if (zend_is_true(return_value)) {
-                               RETURN_BOOL(0);
+                               RETURN_FALSE;
                        }
                }
                php_u_stat(intern->file_name_type, intern->file_name, 
intern->file_name_len, FS_IS_DIR, FG(default_context), return_value TSRMLS_CC);
@@ -961,6 +961,7 @@
        subdir = 
(spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC);
        if (subdir) {
                if (intern->u.dir.sub_path.v && intern->u.dir.sub_path_len > 1) 
{
+                       subdir->u.dir.sub_path_type = 
intern->u.dir.sub_path_type;
                        subdir->u.dir.sub_path_len = 
zspprintf(intern->u.dir.sub_path_type, &subdir->u.dir.sub_path, 0, "%R%c%s", 
intern->u.dir.sub_path_type, intern->u.dir.sub_path, DEFAULT_SLASH, 
intern->u.dir.entry.d_name);
                } else {
                        subdir->u.dir.sub_path_len = 
strlen(intern->u.dir.entry.d_name);
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug36258.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/spl/tests/bug36258.phpt
diff -u php-src/ext/spl/tests/bug36258.phpt:1.3 
php-src/ext/spl/tests/bug36258.phpt:1.4
--- php-src/ext/spl/tests/bug36258.phpt:1.3     Thu Mar 23 15:05:02 2006
+++ php-src/ext/spl/tests/bug36258.phpt Fri Jan 19 00:36:11 2007
@@ -13,9 +13,13 @@
        break;
 }
 
-echo "Done\n";
 ?>
+===DONE===
 --EXPECTF--    
 string(%d) "%s"
 string(%d) "%s"
-Done
+===DONE===
+--UEXPECTF--   
+unicode(%d) "%s"
+unicode(%d) "%s"
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug36287.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/spl/tests/bug36287.phpt
diff -u php-src/ext/spl/tests/bug36287.phpt:1.3 
php-src/ext/spl/tests/bug36287.phpt:1.4
--- php-src/ext/spl/tests/bug36287.phpt:1.3     Sun May 21 12:48:42 2006
+++ php-src/ext/spl/tests/bug36287.phpt Fri Jan 19 00:36:11 2007
@@ -32,3 +32,13 @@
 Second
 string(%d) "%s"
 ===DONE===
+--UEXPECTF--
+First
+unicode(%d) "%s"
+Second
+unicode(%d) "%s"
+First
+unicode(%d) "%s"
+Second
+unicode(%d) "%s"
+===DONE===

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

Reply via email to