cvs: php-src(PHP_5_3) /ext/standard dir.c /ext/standard/tests/file bug45181.phpt

From: Date: Mon, 11 Aug 2008 22:38:31 +0000
Subject: cvs: php-src(PHP_5_3) /ext/standard dir.c /ext/standard/tests/file bug45181.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-52243@lists.php.net to get a copy of this message
lbarnaud Mon Aug 11 22:38:31 2008 UTC Added files: (Branch: PHP_5_3) /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.12.2.9&r2=1.147.2.3.2.12.2.10&diff_format=u Index: php-src/ext/standard/dir.c diff -u php-src/ext/standard/dir.c:1.147.2.3.2.12.2.9 php-src/ext/standard/dir.c:1.147.2.3.2.12.2.10 --- php-src/ext/standard/dir.c:1.147.2.3.2.12.2.9 Thu Jul 24 12:49:11 2008 +++ php-src/ext/standard/dir.c Mon Aug 11 22:38:31 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.147.2.3.2.12.2.9 2008/07/24 12:49:11 felipe Exp $ */ +/* $Id: dir.c,v 1.147.2.3.2.12.2.10 2008/08/11 22:38:31 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> @@ -330,6 +331,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)

« previous php.cvs (#52243) next »