diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-07-20 22:45:05 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-07-20 22:45:05 +0200 |
commit | 7aa2be060ce1a11f124be7d03b0a526a715e07ba (patch) | |
tree | e1ebcba224cb4905df502dd4242732cf8d4747fd /sapi/phpdbg/phpdbg_cmd.c | |
parent | f0b50963e5e526e81bd488d94152c81a6033dfaa (diff) | |
download | php-git-7aa2be060ce1a11f124be7d03b0a526a715e07ba.tar.gz |
Fix readline/libedit build
Diffstat (limited to 'sapi/phpdbg/phpdbg_cmd.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_cmd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index e28e3a9693..12eb3874fd 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -716,7 +716,7 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ #define USE_LIB_STAR (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)) /* note: EOF makes readline write prompt again in local console mode - and ignored if compiled without readline */ #if USE_LIB_STAR - if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) || !isatty(PHPDBG_G(io)[PHPDBG_STDOUT].fd)) + if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) || !isatty(PHPDBG_G(io)[PHPDBG_STDIN].fd)) #endif { phpdbg_write("prompt", "", "%s", phpdbg_get_prompt()); @@ -726,9 +726,7 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ else { cmd = readline(phpdbg_get_prompt()); PHPDBG_G(last_was_newline) = 1; - } - if (!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) { if (!cmd) { PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED; zend_bailout(); @@ -744,7 +742,7 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ buffer = estrdup(cmd); #if USE_LIB_STAR - if (!buffered && cmd && !(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) { + if (!buffered && cmd && !(PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && isatty(PHPDBG_G(io)[PHPDBG_STDIN].fd)) { free(cmd); } #endif |