From: Johannes Schlüter Date: Thu, 6 Oct 2005 20:39:26 +0000 (+0000) Subject: - MFH: Fix #34557 php -m exits with "error" 1 X-Git-Tag: php-4.4.1RC1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac41083b8244bbdee151983a16c928e97282a1ec;p=php - MFH: Fix #34557 php -m exits with "error" 1 --- diff --git a/NEWS b/NEWS index 02f68f98ab..5466f13ac9 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PHP 4 NEWS - Fixed bug #34645 (ctype corrupts memory when validating large numbers). (Ilia) - Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters). (Marco, Ilia) +- Fixed bug #34557 (php -m exits with "error" 1). (Johannes) - Fixed bug #34456 (Possible crash inside pspell extension). (Nuno) - Fixed bug #34311 (unserialize() crashes with chars above 191 dec). (Nuno) - Fixed bug #34307 (on_modify handler not called to set the default value if diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index a94a7808d8..393b560150 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1395,7 +1395,7 @@ consult the installation file that came with this distribution, or visit \n\ } php_print_info(0xFFFFFFFF TSRMLS_CC); php_end_ob_buffers(1 TSRMLS_CC); - exit(1); + exit(0); break; case 'l': /* syntax check mode */ @@ -1413,7 +1413,7 @@ consult the installation file that came with this distribution, or visit \n\ print_extensions(TSRMLS_C); php_printf("\n"); php_end_ob_buffers(1 TSRMLS_CC); - exit(1); + exit(0); break; #if 0 /* not yet operational, see also below ... */ @@ -1446,7 +1446,7 @@ consult the installation file that came with this distribution, or visit \n\ php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_end_ob_buffers(1 TSRMLS_CC); - exit(1); + exit(0); break; case 'w': diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 18758d5330..bf004a4a33 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -623,8 +623,9 @@ int main(int argc, char *argv[]) php_output_activate(TSRMLS_C); php_cli_usage(argv[0]); php_end_ob_buffers(1 TSRMLS_CC); - exit_status=1; - goto err; + exit_status=0; + zend_ini_deactivate(TSRMLS_C); + goto out_err; case 'i': /* php info & quit */ @@ -633,7 +634,7 @@ int main(int argc, char *argv[]) } php_print_info(0xFFFFFFFF TSRMLS_CC); php_end_ob_buffers(1 TSRMLS_CC); - exit_status=1; + exit_status=0; goto out; case 'm': /* list compiled in modules */ @@ -645,8 +646,9 @@ int main(int argc, char *argv[]) print_extensions(TSRMLS_C); php_printf("\n"); php_end_ob_buffers(1 TSRMLS_CC); - exit_status=1; - goto err; + exit_status=0; + zend_ini_deactivate(TSRMLS_C); + goto out_err; case 'v': /* show php version & quit */ if (php_request_startup(TSRMLS_C)==FAILURE) { @@ -658,7 +660,7 @@ int main(int argc, char *argv[]) php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_end_ob_buffers(1 TSRMLS_CC); - exit_status=1; + exit_status=0; goto out; default: