cvs: php-src /ext/spl spl_directory.c
| From: | Etienne Kneuss | Date: | Thu, 15 May 2008 17:22:03 +0000 |
| Subject: | cvs: php-src /ext/spl spl_directory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-49985@lists.php.net to get a copy of this message | ||
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);