From: krakjoe Date: Tue, 19 Nov 2013 13:11:45 +0000 (+0000) Subject: bail on fail for console input, fix - ./phpdbg X-Git-Tag: php-5.6.0alpha1~110^2~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf4b451d39f936689fdf51cac6d8847147a1edd5;p=php bail on fail for console input, fix - ./phpdbg --- diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 41dead1d1b..b09722334a 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -129,6 +129,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */ char buf[PHPDBG_MAX_CMD]; if (!phpdbg_write(PROMPT) || !fgets(buf, PHPDBG_MAX_CMD, stdin)) { + /* the user has gone away */ + phpdbg_error("Failed to read console !"); + PHPDBG_G(flags) |= PHPDBG_IS_QUITTING; + zend_bailout(); return NULL; } @@ -136,6 +140,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */ #else char *cmd = readline(PROMPT); if (!cmd) { + /* the user has gone away */ + phpdbg_error("Failed to read console !"); + PHPDBG_G(flags) |= PHPDBG_IS_QUITTING; + zend_bailout(); return NULL; }