Merge branch 'PHP-7.2' of git.php.net:php-src into PHP-7.2

* 'PHP-7.2' of git.php.net:php-src:
  [ci skip] update NEWS
  [ci skip] update NEWS
  Fixed bug #73830 Directory does not exist.
This commit is contained in:
Frank Denis 2017-11-28 13:56:46 +01:00
commit f2cb9c39c4
2 changed files with 23 additions and 0 deletions

3
NEWS
View File

@ -9,6 +9,9 @@ PHP NEWS
. Fixed bug #74862 (Unable to clone instance when private __clone defined).
(Daniel Ciochiu)
- CLI server:
. Fixed bug #73830 (Directory does not exist). (Anatol)
- Opcache:
. Fixed bug #75570 ("Narrowing occurred during type inference" error).
(Dmitry)

View File

@ -2519,6 +2519,10 @@ int do_cli_server(int argc, char **argv) /* {{{ */
const char *server_bind_address = NULL;
extern const opt_struct OPTIONS[];
const char *document_root = NULL;
#ifdef PHP_WIN32
char document_root_tmp[MAXPATHLEN];
size_t k;
#endif
const char *router = NULL;
char document_root_buf[MAXPATHLEN];
@ -2528,7 +2532,23 @@ int do_cli_server(int argc, char **argv) /* {{{ */
server_bind_address = php_optarg;
break;
case 't':
#ifndef PHP_WIN32
document_root = php_optarg;
#else
k = strlen(php_optarg);
if (k + 1 > MAXPATHLEN) {
fprintf(stderr, "Document root path is too long.\n");
return 1;
}
memmove(document_root_tmp, php_optarg, k + 1);
/* Clean out any trailing garbage that might have been passed
from a batch script. */
do {
document_root_tmp[k] = '\0';
k--;
} while ('"' == document_root_tmp[k] || ' ' == document_root_tmp[k]);
document_root = document_root_tmp;
#endif
break;
}
}