From: Anatol Belski Date: Sun, 27 Sep 2015 13:46:07 +0000 (+0200) Subject: fix phpdbg's -h switch X-Git-Tag: php-7.1.0alpha1~1083^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c82e21619eb0644221a166c1179bed0f08c2f640;p=php fix phpdbg's -h switch The help functionality needs a correct stdout fd, so pre setup it for the only case. --- diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index a66576c61e..c3f0cc6c54 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1500,6 +1500,10 @@ phpdbg_main: sapi_startup(phpdbg); phpdbg->startup(phpdbg); PHPDBG_G(flags) = 0; + /* It ain't gonna proceed to real execution anyway, + but the correct descriptor is needed already. */ + PHPDBG_G(io)[PHPDBG_STDOUT].ptr = stdout; + PHPDBG_G(io)[PHPDBG_STDOUT].fd = fileno(stdout); phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT); phpdbg_do_help(NULL); sapi_deactivate();