summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_cmd.c
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2019-03-27 10:04:18 +0100
committerJoe Watkins <krakjoe@php.net>2019-03-27 10:04:36 +0100
commit56293d0637b3e9e706414e3f5689d153ba6bb1f2 (patch)
treee726709e0315209b7383e69ccdf7c40b71b8f410 /sapi/phpdbg/phpdbg_cmd.c
parentf177a2ac586124374e13b93da0c0b9e0e4980ff6 (diff)
parenteb405a2192bd8a0092c0795cd161d96b89f9d534 (diff)
downloadphp-git-56293d0637b3e9e706414e3f5689d153ba6bb1f2.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #77805 phpdbg build fails when readline is shared
Diffstat (limited to 'sapi/phpdbg/phpdbg_cmd.c')
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 0357b63bda..b736481089 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -751,20 +751,15 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */
}
if (buffered == NULL) {
-#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
-#define USE_LIB_STAR 1
-#else
-#define USE_LIB_STAR 0
-#endif
+#ifdef HAVE_PHPDBG_READLINE
/* 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_STDIN].fd))
#endif
{
phpdbg_write("prompt", "", "%s", phpdbg_get_prompt());
phpdbg_consume_stdin_line(cmd = buf);
}
-#if USE_LIB_STAR
+#ifdef HAVE_PHPDBG_READLINE
else {
cmd = readline(phpdbg_get_prompt());
PHPDBG_G(last_was_newline) = 1;
@@ -783,7 +778,7 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */
buffer = estrdup(cmd);
-#if USE_LIB_STAR
+#ifdef HAVE_PHPDBG_READLINE
if (!buffered && cmd && !(PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && isatty(PHPDBG_G(io)[PHPDBG_STDIN].fd)) {
free(cmd);
}