com php-src: Exempt paging from -qrr mode: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_io.c
| From: | Bob Weinand | Date: | Tue, 20 Oct 2015 19:56:00 +0000 |
| Subject: | com php-src: Exempt paging from -qrr mode: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_io.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89476@lists.php.net to get a copy of this message | ||
Commit: 2ef327caed5e7cb2683c040904a57d0cc6be1e5d
Author: Bob Weinand <bobwei9@hotmail.com> Tue, 20 Oct 2015 21:56:00 +0200
Parents: 1149833a58a478b35bd95f4c4b9f23fe52c719d6
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ef327caed5e7cb2683c040904a57d0cc6be1e5d
Log:
Exempt paging from -qrr mode
Changed paths:
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg_io.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index a82292a..1fda4b7 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1845,7 +1845,7 @@ phpdbg_interact:
quit_immediately = phpdbg_startup_run > 1;
phpdbg_startup_run = 0;
if (quit_immediately) {
- PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE | PHPDBG_PREVENT_INTERACTIVE;
+ PHPDBG_G(flags) = (PHPDBG_G(flags) & ~PHPDBG_HAS_PAGINATION) | PHPDBG_IS_INTERACTIVE |
PHPDBG_PREVENT_INTERACTIVE;
} else {
PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE;
}
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index cf4fdb8..98628b7 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -202,13 +202,13 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
bytes += write(sock, ptr + bytes, (p - ptr) - bytes);
if (memchr(p, '\n', endp - p)) {
- int chr;
- printf("\r---Type <return> to continue or q <return> to quit---");
- chr = getchar();
- if (chr == 'q') {
+ char buf[PHPDBG_MAX_CMD];
+ write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to
quit---"));
+ phpdbg_consume_stdin_line(buf);
+ if (*buf == 'q') {
break;
}
- printf("\r");
+ write(sock, "\r", 1);
} else break;
}
}
@@ -225,9 +225,10 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
return phpdbg_send_bytes(sock, ptr, len);
}
- if (PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION
- && PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
- && PHPDBG_G(lines) > 0) {
+ if ((PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION)
+ && !(PHPDBG_G(flags) & PHPDBG_WRITE_XML)
+ && PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
+ && PHPDBG_G(lines) > 0) {
return phpdbg_output_pager(sock, ptr, len);
}