summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-09-27 15:46:07 +0200
committerAnatol Belski <ab@php.net>2015-09-27 15:46:07 +0200
commitc82e21619eb0644221a166c1179bed0f08c2f640 (patch)
treeb8aca5dd09f434080136c9de58799fb0e06726de /sapi/phpdbg/phpdbg.c
parent7e3cd7cadf015c63d1042899b7ba5e5719cb4ce5 (diff)
downloadphp-git-c82e21619eb0644221a166c1179bed0f08c2f640.tar.gz
fix phpdbg's -h switch
The help functionality needs a correct stdout fd, so pre setup it for the only case.
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r--sapi/phpdbg/phpdbg.c4
1 files changed, 4 insertions, 0 deletions
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();