com php-src: Better fix for bug #73360: sapi/cli/php_cli_se rver.c
| From: | Anatol Belski | Date: | Fri, 21 Oct 2016 19:29:35 +0000 |
| Subject: | com php-src: Better fix for bug #73360: sapi/cli/php_cli_se rver.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95258@lists.php.net to get a copy of this message | ||
Commit: 2860fd40d6af162b302eec73d462db6ff5113a6a
Author: Anatol Belski <ab@php.net> Fri, 21 Oct 2016 21:29:35 +0200
Parents: fbf46d36ca3d1fb0a285437ae1dcf99c6bee86d5
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2860fd40d6af162b302eec73d462db6ff5113a6a
Log:
Better fix for bug #73360
This also fixes the TS issue. And, it also reveals that there's an
issue in the VCWD_* API to be possibly addressed.
Bugs:
https://bugs.php.net/73360
Changed paths:
M sapi/cli/php_cli_server.c
Diff:
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 7ae6c6f..0853db9 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1400,7 +1400,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request
*reque
*p = '\0';
q = p;
while (q > buf) {
- if (!zend_stat(buf, &sb)) {
+ if (!php_sys_stat(buf, &sb)) {
if (sb.st_mode & S_IFDIR) {
const char **file = index_files;
if (q[-1] != DEFAULT_SLASH) {
@@ -1409,7 +1409,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request
*reque
while (*file) {
size_t l = strlen(*file);
memmove(q, *file, l + 1);
- if (!zend_stat(buf, &sb) && (sb.st_mode & S_IFREG)) {
+ if (!php_sys_stat(buf, &sb) && (sb.st_mode & S_IFREG)) {
q += l;
break;
}
@@ -2502,7 +2502,7 @@ int do_cli_server(int argc, char **argv) /* {{{ */
if (document_root) {
zend_stat_t sb;
- if (zend_stat(document_root, &sb)) {
+ if (php_sys_stat(document_root, &sb)) {
fprintf(stderr, "Directory %s does not exist.\n", document_root);
return 1;
}