cvs: php-src(PHP_5_3) /ext/spl spl_directory.c
| From: | Marcus Boerger | Date: | Wed, 30 Jan 2008 23:08:14 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/spl spl_directory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-48185@lists.php.net to get a copy of this message | ||
helly Wed Jan 30 23:08:14 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/spl spl_directory.c
Log:
- Sub path may be NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.23.2.8&r2=1.45.2.27.2.23.2.9&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.8
php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.9
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.23.2.8 Wed Jan 30 20:31:06 2008
+++ php-src/ext/spl/spl_directory.c Wed Jan 30 23:08:13 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.8 2008/01/30 20:31:06 helly Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.23.2.9 2008/01/30 23:08:13 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -511,7 +511,11 @@
}
efree(pnstr);
pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName",
sizeof("subPathName")-1, &pnlen TSRMLS_CC);
- add_assoc_stringl_ex(&zrv, pnstr, pnlen+1, intern->u.dir.sub_path,
intern->u.dir.sub_path_len, 1);
+ if (intern->u.dir.sub_path) {
+ add_assoc_stringl_ex(&zrv, pnstr, pnlen+1, intern->u.dir.sub_path,
intern->u.dir.sub_path_len, 1);
+ } else {
+ add_assoc_stringl_ex(&zrv, pnstr, pnlen+1, "", 0, 1);
+ }
efree(pnstr);
}
if (intern->type == SPL_FS_FILE) {