diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-27 13:32:29 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-27 13:32:38 +0100 |
commit | 1cccbb8ff1339c44075e7dee8613d98dc8056f68 (patch) | |
tree | 3eb848778ca364b6a819b684b4ee6c694ef693c1 /sapi/cli/php_cli.c | |
parent | 41e1891e0c2c4d9c3827d8e95dff735eee38268d (diff) | |
parent | fd08f062ae5a3c92bfc0345da7e83ab320046864 (diff) | |
download | php-git-1cccbb8ff1339c44075e7dee8613d98dc8056f68.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix bug #78323: Code 0 is returned on invalid options
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index a305c36ade..1b14b7586b 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1228,7 +1228,7 @@ int main(int argc, char *argv[]) setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2))!=-1) { + while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2))!=-1) { switch (c) { case 'c': if (ini_path_override) { @@ -1280,6 +1280,10 @@ int main(int argc, char *argv[]) case '?': php_cli_usage(argv[0]); goto out; + case PHP_GETOPT_INVALID_ARG: /* print usage on bad options, exit 1 */ + php_cli_usage(argv[0]); + exit_status = 1; + goto out; case 'i': case 'v': case 'm': sapi_module = &cli_sapi_module; goto exit_loop; |