]> granicus.if.org Git - php/commitdiff
Fix bug #55496 Interactive mode doesn't force a newline before the prompt
authorJohannes Schlüter <johannes@php.net>
Thu, 24 Jul 2014 14:53:51 +0000 (16:53 +0200)
committerJohannes Schlüter <johannes@php.net>
Thu, 24 Jul 2014 14:53:51 +0000 (16:53 +0200)
NEWS
ext/readline/readline_cli.c

diff --git a/NEWS b/NEWS
index 144d86b4e245dfea54eadd2b346f57d3bf42dd2b..c4592a35363ee63cc9401b20e2585a84e5b0c851 100644 (file)
--- 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:
index c2bf8764cb415939bcb7fba8629d74f9e439cd33..9655777775a4cc1262f6cd0dec09b057c2a9eef9 100644 (file)
@@ -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)) {