colder Thu May 15 17:22:03 2008 UTC Modified files: /php-src/ext/spl spl_directory.c Log: Replace the iterator correctly after being cloned (related to #44964) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.152&r2=1.153&diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.152 php-src/ext/spl/spl_directory.c:1.153 --- php-src/ext/spl/spl_directory.c:1.152 Sat May 3 16:01:00 2008 +++ php-src/ext/spl/spl_directory.c Thu May 15 17:22:03 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.152 2008/05/03 16:01:00 colder Exp $ */ +/* $Id: spl_directory.c,v 1.153 2008/05/15 17:22:03 colder Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -298,6 +298,7 @@ zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); spl_filesystem_object *intern; spl_filesystem_object *source; + int index; old_object = zend_objects_get_address(zobject TSRMLS_CC); source = (spl_filesystem_object*)old_object; @@ -316,6 +317,11 @@ break; case SPL_FS_DIR: spl_filesystem_dir_open(intern, source->_path_type, source->_path, source->_path_len TSRMLS_CC); + /* read until we hit the position in which we were before */ + for(index = 0; index < source->u.dir.index; ++index) { + spl_filesystem_dir_read(intern TSRMLS_CC); + } + intern->u.dir.index = index; break; case SPL_FS_FILE: php_error_docref(NULL TSRMLS_CC, E_ERROR, "An object of class %v cannot be cloned", old_object->ce->name);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php