cvs: TSRM(PHP_5_3) / tsrm_virtual_cwd.c php-src/ext/standard/tests/file realpath_basic4.phpt
"Dmitry Stogov" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.zend |
|---|---|
| Message-ID | <cvsdmitry1219055297@cvsserver> |
dmitry Mon Aug 18 10:28:17 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/file realpath_basic4.phpt
Modified files:
/TSRM tsrm_virtual_cwd.c
Log:
Fixed bug #45835 (include and symlinks)
http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.9.2.35.2.11&r2=1.74.2.9.2.35.2.12&diff_format=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.11 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.12
--- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.11 Mon Aug 18 09:31:34 2008
+++ TSRM/tsrm_virtual_cwd.c Mon Aug 18 10:28:17 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.11 2008/08/18 09:31:34 dmitry Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.12 2008/08/18 10:28:17 dmitry Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -587,6 +587,9 @@
/* not a directory */
return -1;
} else {
+ if (link_is_dir) {
+ *link_is_dir = bucket->is_dir;
+ }
memcpy(path, bucket->realpath, bucket->realpath_len + 1);
return bucket->realpath_len;
}
@@ -656,6 +659,9 @@
return -1;
}
}
+ if (link_is_dir) {
+ *link_is_dir = directory;
+ }
} else {
if (save) {
directory = S_ISDIR(st.st_mode);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/realpath_basic4.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/realpath_basic4.phpt
+++ php-src/ext/standard/tests/file/realpath_basic4.phpt
--TEST--
Test realpath() with relative paths
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip no symlinks on Windows');
}
?>
--FILE--
<?php
$file_path = dirname(__FILE__);
@mkdir("$file_path/realpath_basic/home/test", 0777, true);
@symlink("$file_path/realpath_basic/home", "$file_path/realpath_basic/link1");
@symlink("$file_path/realpath_basic/link1", "$file_path/realpath_basic/link2");
echo "1. " . realpath("$file_path/realpath_basic/link2") . "\n";
echo "2. " . realpath("$file_path/realpath_basic/link2/test") . "\n";
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__);
unlink("$file_path/realpath_basic/link2");
unlink("$file_path/realpath_basic/link1");
rmdir("$file_path/realpath_basic/home/test");
rmdir("$file_path/realpath_basic/home");
rmdir("$file_path/realpath_basic");
?>
--EXPECTF--
1. %s%erealpath_basic%ehome
2. %s%erealpath_basic%ehome%etest
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php