lbarnaud Mon Aug 11 22:39:42 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/file bug45181.phpt
Modified files: /php-src/ext/standard dir.c Log: MFH: Fixed #45181 (chdir() should clear relative entries in stat cache) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dir.c?r1=1.147.2.3.2.18&r2=1.147.2.3.2.19&diff_format=u Index: php-src/ext/standard/dir.c diff -u php-src/ext/standard/dir.c:1.147.2.3.2.18 php-src/ext/standard/dir.c:1.147.2.3.2.19 --- php-src/ext/standard/dir.c:1.147.2.3.2.18 Wed Jul 23 11:25:50 2008 +++ php-src/ext/standard/dir.c Mon Aug 11 22:39:42 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.147.2.3.2.18 2008/07/23 11:25:50 tony2001 Exp $ */ +/* $Id: dir.c,v 1.147.2.3.2.19 2008/08/11 22:39:42 lbarnaud Exp $ */ /* {{{ includes/startup/misc */ @@ -26,6 +26,7 @@ #include "php_dir.h" #include "php_string.h" #include "php_scandir.h" +#include "basic_functions.h" #ifdef HAVE_DIRENT_H #include <dirent.h> @@ -329,6 +330,15 @@ RETURN_FALSE; } + if (BG(CurrentStatFile) && !IS_ABSOLUTE_PATH(BG(CurrentStatFile), strlen(BG(CurrentStatFile)))) { + efree(BG(CurrentStatFile)); + BG(CurrentStatFile) = NULL; + } + if (BG(CurrentLStatFile) && !IS_ABSOLUTE_PATH(BG(CurrentLStatFile), strlen(BG(CurrentLStatFile)))) { + efree(BG(CurrentLStatFile)); + BG(CurrentLStatFile) = NULL; + } + RETURN_TRUE; } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug45181.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug45181.phpt +++ php-src/ext/standard/tests/file/bug45181.phpt --TEST-- Bug #45181 (chdir() should clear relative entries in stat cache) --FILE-- <?php mkdir("bug45181_x"); var_dump(is_dir("bug45181_x")); chdir("bug45181_x"); var_dump(is_dir("bug45181_x")); ?> --CLEAN-- <?php rmdir("bug45181_x"); ?> --EXPECT-- bool(true) bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php