From 71d3a69425449972f4efdf7228c6f7e49e090755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Thu, 24 Jul 2014 16:53:51 +0200 Subject: [PATCH 1/2] Fix bug #55496 Interactive mode doesn't force a newline before the prompt --- NEWS | 4 ++++ ext/readline/readline_cli.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 144d86b4e245d..c4592a35363ee 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2014, PHP 5.4.32 +- Readline: + . Fixed bug #55496 (Interactive mode doesn't force a newline before the + prompt). (Bob, Johannes) + ?? ??? 2014, PHP 5.4.31 - Core: diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index c2bf8764cb415..9655777775a4c 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -99,6 +99,9 @@ static size_t readline_shell_write(const char *str, uint str_length TSRMLS_DC) / static int readline_shell_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ { + /* We just store the last char here and then pass back to the + caller (sapi_cli_single_write in sapi/cli) which will actually + write due to -1 return code */ php_last_char = str[str_length-1]; return -1; } @@ -667,7 +670,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */ pos = 0; if (!pager_pipe && php_last_char != '\0' && php_last_char != '\n') { - readline_shell_write("\n", 1 TSRMLS_CC); + php_write("\n", 1 TSRMLS_CC); } if (EG(exception)) { From 899b369e1565be8a19ce90c323b7ae63ecbd185b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Thu, 24 Jul 2014 16:58:05 +0200 Subject: [PATCH 2/2] BFN --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 845049a2c40c2..9e4751431740a 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #67635 (php links to systemd libraries without using pkg-config). (pacho@gentoo.org, Remi) +- readline: + . Fixed bug #55496 (Interactive mode doesn't force a newline before the + prompt). (Bob, Johannes) + ?? ??? 2014, PHP 5.5.15 - Core: