com php-src: Do not use readline when not having a tty This is important for e.g. run-tests.php: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg _cmd.c
| From: | Bob Weinand | Date: | Mon, 20 Jul 2015 19:57:00 +0000 |
| Subject: | com php-src: Do not use readline when not having a tty This is important for e.g. run-tests.php: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg _cmd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88062@lists.php.net to get a copy of this message | ||
Commit: f0b50963e5e526e81bd488d94152c81a6033dfaa
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 20 Jul 2015 21:57:00 +0200
Parents: 6aadeba213305a0b8818c347bea956cb7e258c3a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f0b50963e5e526e81bd488d94152c81a6033dfaa
Log:
Do not use readline when not having a tty
This is important for e.g. run-tests.php
Changed paths:
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg_cmd.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 3fdc7cb..d594601 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -564,7 +564,7 @@ static PHP_FUNCTION(phpdbg_end_oplog)
last_function = op_array->function_name;
last_scope = op_array->scope;
if (last_scope == NULL) {
- fn_name = zend_string_copy(last_function ? last_function : last_file);
+ fn_name = zend_string_copy(last_function);
} else {
fn_name = strpprintf(ZSTR_LEN(last_function) + ZSTR_LEN(last_scope->name) + 2,
"%.*s::%.*s", ZSTR_LEN(last_scope->name), ZSTR_VAL(last_scope->name),
ZSTR_LEN(last_function), ZSTR_VAL(last_function));
}
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 97be41d..e28e3a9 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)
+ if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) || !isatty(PHPDBG_G(io)[PHPDBG_STDOUT].fd))
#endif
{
phpdbg_write("prompt", "", "%s", phpdbg_get_prompt());