]> granicus.if.org Git - php/commitdiff
bail on fail for console input, fix - ./phpdbg
authorkrakjoe <joe.watkins@live.co.uk>
Tue, 19 Nov 2013 13:11:45 +0000 (13:11 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Tue, 19 Nov 2013 13:11:45 +0000 (13:11 +0000)
phpdbg_cmd.c

index 41dead1d1b67b0f84a5ab15f8be6676659de43b7..b09722334a6c3f24c5fd149cb30969d6e214c1e6 100644 (file)
@@ -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;
                }