From cf4b451d39f936689fdf51cac6d8847147a1edd5 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Tue, 19 Nov 2013 13:11:45 +0000 Subject: [PATCH] bail on fail for console input, fix - ./phpdbg --- phpdbg_cmd.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.50.1