]> granicus.if.org Git - php/commitdiff
- Fixed bug #55076 (requires() fails in a subdirectory with the in-built webserver)
authorFelipe Pena <felipe@php.net>
Wed, 6 Jul 2011 01:54:54 +0000 (01:54 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 6 Jul 2011 01:54:54 +0000 (01:54 +0000)
sapi/cli/php_cli_server.c

index 365f35224420265df7b82b5da189362841b3dccc..66d3bc5ae487deb20e8fd030594a9beb9c413a9b 100644 (file)
@@ -2060,6 +2060,8 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
 
        if (document_root) {
                struct stat sb;
+               char resolved_path[MAXPATHLEN];
+
                if (stat(document_root, &sb)) {
                        fprintf(stderr, "Directory %s does not exist.\n", document_root);
                        return 1;
@@ -2068,6 +2070,9 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
                        fprintf(stderr, "%s is not a directory.\n", document_root);
                        return 1;
                }
+               if (VCWD_REALPATH(document_root, resolved_path)) {
+                       document_root = resolved_path;
+               }
        } else {
                char path[MAXPATHLEN];
                char *ret = NULL;