File tree 2 files changed +29
-9
lines changed
2 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ PHP NEWS
35
35
- PDO_Firebird:
36
36
. Fix bogus fallthrough path in firebird_handle_get_attribute(). (nielsdos)
37
37
38
+ - PHPDBG:
39
+ . Fixed bug GH-13199 (EOF emits redundant prompt in phpdbg local console mode
40
+ with libedit/readline). (Peter Kokot)
41
+
38
42
- Soap:
39
43
. Fixed bug #55639 (Digest autentication dont work). (nielsdos)
40
44
Original file line number Diff line number Diff line change 23
23
#include "phpdbg_prompt.h"
24
24
#include "phpdbg_io.h"
25
25
26
+ #ifdef HAVE_UNISTD_H
27
+ # include <unistd.h>
28
+ #endif
29
+
26
30
ZEND_EXTERN_MODULE_GLOBALS (phpdbg )
27
31
28
32
static inline const char * phpdbg_command_name (const phpdbg_command_t * command , char * buffer ) {
@@ -746,17 +750,29 @@ PHPDBG_API char *phpdbg_read_input(const char *buffered) /* {{{ */
746
750
if ((PHPDBG_G (flags ) & (PHPDBG_IS_STOPPING | PHPDBG_IS_RUNNING )) != PHPDBG_IS_STOPPING ) {
747
751
if (buffered == NULL ) {
748
752
#ifdef HAVE_PHPDBG_READLINE
749
- char * cmd = readline (phpdbg_get_prompt ());
750
- PHPDBG_G (last_was_newline ) = 1 ;
753
+ # ifdef HAVE_UNISTD_H
754
+ /* EOF makes readline write prompt again in local console mode and
755
+ ignored if compiled without readline integration. */
756
+ if (!isatty (PHPDBG_G (io )[PHPDBG_STDIN ].fd )) {
757
+ char buf [PHPDBG_MAX_CMD ];
758
+ phpdbg_write ("%s" , phpdbg_get_prompt ());
759
+ phpdbg_consume_stdin_line (buf );
760
+ buffer = estrdup (buf );
761
+ } else
762
+ # endif
763
+ {
764
+ char * cmd = readline (phpdbg_get_prompt ());
765
+ PHPDBG_G (last_was_newline ) = 1 ;
766
+
767
+ if (!cmd ) {
768
+ PHPDBG_G (flags ) |= PHPDBG_IS_QUITTING ;
769
+ zend_bailout ();
770
+ }
751
771
752
- if (! cmd ) {
753
- PHPDBG_G ( flags ) |= PHPDBG_IS_QUITTING ;
754
- zend_bailout ( );
772
+ add_history ( cmd );
773
+ buffer = estrdup ( cmd ) ;
774
+ free ( cmd );
755
775
}
756
-
757
- add_history (cmd );
758
- buffer = estrdup (cmd );
759
- free (cmd );
760
776
#else
761
777
phpdbg_write ("%s" , phpdbg_get_prompt ());
762
778
phpdbg_consume_stdin_line (buf );
You can’t perform that action at this time.
0 commit comments