1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00

- Bugfix #40546: SplFileInfo::getPathInfo() throws an execption if directory is in root dir.

This commit is contained in:
Marcus Boerger
2007-02-19 20:32:39 +00:00
parent 86f29b0cf7
commit 9bf2f53e87

View File

@@ -334,11 +334,21 @@ static spl_filesystem_object * spl_filesystem_object_create_info(spl_filesystem_
zval *arg1;
if (!file_path.v || !file_path_len) {
#if defined(PHP_WIN32)
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path");
if (file_path.v && !use_copy)
{
efree(file_path.v);
}
#else
if (file_path.v && !use_copy) {
efree(file_path.v);
}
use_copy = 1;
file_path_len = 1;
file_path.s = "/";
file_type = IS_STRING;
#endif
return NULL;
}