@@ -2048,6 +2048,7 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
2048
2048
extern const opt_struct OPTIONS [];
2049
2049
const char * document_root = NULL ;
2050
2050
const char * router = NULL ;
2051
+ char document_root_buf [MAXPATHLEN ];
2051
2052
2052
2053
while ((c = php_getopt (argc , argv , OPTIONS , & php_optarg , & php_optind , 0 , 2 ))!= -1 ) {
2053
2054
switch (c ) {
@@ -2062,7 +2063,6 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
2062
2063
2063
2064
if (document_root ) {
2064
2065
struct stat sb ;
2065
- char resolved_path [MAXPATHLEN ];
2066
2066
2067
2067
if (stat (document_root , & sb )) {
2068
2068
fprintf (stderr , "Directory %s does not exist.\n" , document_root );
@@ -2072,19 +2072,18 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */
2072
2072
fprintf (stderr , "%s is not a directory.\n" , document_root );
2073
2073
return 1 ;
2074
2074
}
2075
- if (VCWD_REALPATH (document_root , resolved_path )) {
2076
- document_root = resolved_path ;
2075
+ if (VCWD_REALPATH (document_root , document_root_buf )) {
2076
+ document_root = document_root_buf ;
2077
2077
}
2078
2078
} else {
2079
- char path [MAXPATHLEN ];
2080
2079
char * ret = NULL ;
2081
2080
2082
2081
#if HAVE_GETCWD
2083
- ret = VCWD_GETCWD (path , MAXPATHLEN );
2082
+ ret = VCWD_GETCWD (document_root_buf , MAXPATHLEN );
2084
2083
#elif HAVE_GETWD
2085
- ret = VCWD_GETWD (path );
2084
+ ret = VCWD_GETWD (document_root_buf );
2086
2085
#endif
2087
- document_root = ret ? path : "." ;
2086
+ document_root = ret ? document_root_buf : "." ;
2088
2087
}
2089
2088
2090
2089
if (argc > php_optind ) {
0 commit comments