From: Ilia Alshanetsky Date: Mon, 30 May 2011 15:57:50 +0000 (+0000) Subject: Fixed bug #52496 (Zero exit code on option parsing failure). X-Git-Tag: php-5.3.7RC1~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a65eba016e70ea0d0355d412a0b5c5ad4c7f067a;p=php Fixed bug #52496 (Zero exit code on option parsing failure). --- diff --git a/NEWS b/NEWS index e0c676598b..eca47322e6 100644 --- a/NEWS +++ b/NEWS @@ -54,6 +54,9 @@ PHP NEWS . Fixed bug #54529 (SAPI crashes on apache_config.c:197). (hebergement at riastudio dot fr) +- CLI SAPI: + . Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia) + - cURL: . Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre) . Added support for CURLOPT_MAX_RECV_SPEED_LARGE and diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 1bc0f80d0a..b5b95b48a6 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -799,7 +799,7 @@ int main(int argc, char *argv[]) request_started = 1; php_cli_usage(argv[0]); php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; + exit_status = (c == '?' && argc > 1 && !strchr(argv[1], c)); goto out; case 'i': /* php info & quit */