diff options
author | Felipe Pena <felipe@php.net> | 2011-07-03 14:45:41 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-07-03 14:45:41 +0000 |
commit | 7711da059ed014d15b2767acde8c1c08ef477693 (patch) | |
tree | f932a089fca8c75d44f7b462e0bb10c0cd5f073e /sapi/cli/php_cli_server.c | |
parent | 3e6b211935e2bfbd7b80daadb987c8c77f833d51 (diff) | |
download | php-git-7711da059ed014d15b2767acde8c1c08ef477693.tar.gz |
- Fixed bug #55118 (Imcomplete start message)
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index ab2dc6c32b..365f352244 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -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) { |