mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
bail on fail for console input, fix - ./phpdbg
This commit is contained in:
parent
73e7f5c645
commit
cf4b451d39
1 changed files with 8 additions and 0 deletions
|
@ -129,6 +129,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */
|
||||||
char buf[PHPDBG_MAX_CMD];
|
char buf[PHPDBG_MAX_CMD];
|
||||||
if (!phpdbg_write(PROMPT) ||
|
if (!phpdbg_write(PROMPT) ||
|
||||||
!fgets(buf, PHPDBG_MAX_CMD, stdin)) {
|
!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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +140,10 @@ phpdbg_input_t* phpdbg_read_input(TSRMLS_D) /* {{{ */
|
||||||
#else
|
#else
|
||||||
char *cmd = readline(PROMPT);
|
char *cmd = readline(PROMPT);
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
|
/* the user has gone away */
|
||||||
|
phpdbg_error("Failed to read console !");
|
||||||
|
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING;
|
||||||
|
zend_bailout();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue