1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Properly exit on EOF on stdin in readline mode

This commit is contained in:
Bob Weinand
2015-07-07 22:45:34 +02:00
parent b3a4c05071
commit 7a8ea0f60d
2 changed files with 8 additions and 5 deletions

View File

@@ -729,11 +729,15 @@ readline:
PHPDBG_G(last_was_newline) = 1;
}
if (!cmd) {
goto readline;
}
if (!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) {
if (!cmd) {
if (feof(PHPDBG_G(io)[PHPDBG_STDIN].ptr)) {
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED;
zend_bailout();
}
goto readline;
}
add_history(cmd);
}
#endif

View File

@@ -90,7 +90,6 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf) {
if (bytes <= 0) {
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED;
zend_bailout();
return 0;
}
return bytes;