]> granicus.if.org Git - php/commitdiff
- Fixed bug #55118 (Imcomplete start message)
authorFelipe Pena <felipe@php.net>
Sun, 3 Jul 2011 14:45:41 +0000 (14:45 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 3 Jul 2011 14:45:41 +0000 (14:45 +0000)
sapi/cli/php_cli_server.c

index ab2dc6c32b6913903e2cab2a99789ebadb60ec72..365f35224420265df7b82b5da189362841b3dccc 100644 (file)
@@ -2069,7 +2069,15 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
                        return 1;
                }
        } else {
-               document_root = ".";
+               char path[MAXPATHLEN];
+               char *ret = NULL;
+
+#if HAVE_GETCWD
+               ret = VCWD_GETCWD(path, MAXPATHLEN);
+#elif HAVE_GETWD
+               ret = VCWD_GETWD(path);
+#endif
+               document_root = ret ? path : ".";
        }
 
        if (argc > php_optind) {