cvs: php-src(PHP_5_2) /ext/spl spl_directory.c /ext/spl/tests fileobject_003.phpt
| From: | Hannes Magnusson | Date: | Mon, 06 Nov 2006 15:21:45 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/spl spl_directory.c /ext/spl/tests fileobject_003.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41376@lists.php.net to get a copy of this message | ||
bjori Mon Nov 6 15:21:45 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/spl spl_directory.c
/php-src/ext/spl/tests fileobject_003.phpt
Log:
MFH: fix segfault & improve test
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.8&r2=1.45.2.27.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.8 php-src/ext/spl/spl_directory.c:1.45.2.27.2.9
--- php-src/ext/spl/spl_directory.c:1.45.2.27.2.8 Fri Sep 29 13:11:28 2006
+++ php-src/ext/spl/spl_directory.c Mon Nov 6 15:21:45 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.45.2.27.2.8 2006/09/29 13:11:28 bjori Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.9 2006/11/06 15:21:45 bjori Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -406,6 +406,8 @@
} else {
intern->file_name = source->file_name;
intern->file_name_len = source->file_name_len;
+ intern->path = estrndup(source->path, source->path_len);
+ intern->path_len = source->path_len;
intern->u.file.open_mode = "r";
intern->u.file.open_mode_len = 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/spl/tests/fileobject_003.phpt
diff -u php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.3
php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.4
--- php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.3 Sat Jul 15 13:01:59 2006
+++ php-src/ext/spl/tests/fileobject_003.phpt Mon Nov 6 15:21:45 2006
@@ -31,6 +31,9 @@
var_dump($f->getPath());
$l = substr($f->getPath(), -1);
var_dump($l != '/' && $l != '\\' && $l == $lp);
+
+ $fo = $o->openFile();
+ var_dump($fo->getPathName(), $fo->getFileName(), $fo->getPath());
}
test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't',
substr(dirname(__FILE__),-1));
@@ -56,6 +59,9 @@
bool(true)
string(%d) "%stests"
bool(true)
+string(%d) "%sfileobject_001a.txt"
+string(%d) "%sfileobject_001a.txt"
+string(%d) "%stests"
===1===
object(SplFileInfo)#%d (0) {
}
@@ -71,6 +77,9 @@
bool(true)
string(%d) "%sspl"
bool(true)
+string(%d) "%stests"
+string(%d) "%stests"
+string(%d) "%stests"
===2===
object(SplFileInfo)#1 (0) {
}
@@ -86,4 +95,7 @@
bool(true)
string(%d) "%sspl"
bool(true)
+string(%d) "%stests"
+string(%d) "%stests"
+string(%d) "%sspl"
===DONE===