]> granicus.if.org Git - php/commitdiff
Better fix for bug #73360
authorAnatol Belski <ab@php.net>
Fri, 21 Oct 2016 19:29:35 +0000 (21:29 +0200)
committerAnatol Belski <ab@php.net>
Fri, 21 Oct 2016 19:29:35 +0000 (21:29 +0200)
This also fixes the TS issue. And, it also reveals that there's an
issue in the VCWD_* API to be possibly addressed.

sapi/cli/php_cli_server.c

index 7ae6c6f1a40eb198b9bd1679bfbfe5af2a67f8cc..0853db99bb8c02993cdb20437d9b99c7bc3bc266 100644 (file)
@@ -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;
                }