com php-src: Combine conditions for the automatic interactive console activation: win32/console.c
| From: | Anatol Belski | Date: | Mon, 24 Jul 2017 12:47:32 +0000 |
| Subject: | com php-src: Combine conditions for the automatic interactive console activation: win32/console.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98767@lists.php.net to get a copy of this message | ||
Commit: 8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568
Author: Anatol Belski <ab@php.net> Mon, 24 Jul 2017 14:47:32 +0200
Parents: 742895f60c82f2caa22e933606a4807c73ca6851
Branches: PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568
Log:
Combine conditions for the automatic interactive console activation
as with bug #74979 it seems to have regressions which were not
present before.
Bugs:
https://bugs.php.net/74979
Changed paths:
M win32/console.c
Diff:
diff --git a/win32/console.c b/win32/console.c
index c321a37..0d52fd1 100644
--- a/win32/console.c
+++ b/win32/console.c
@@ -94,10 +94,18 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e
PHP_WINUTIL_API BOOL php_win32_console_is_own(void)
{/*{{{*/
- CONSOLE_SCREEN_BUFFER_INFO csbi;
+ if (!IsDebuggerPresent()) {
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ DWORD pl[1];
+ BOOL ret0 = FALSE, ret1 = FALSE;
- if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) &&
!IsDebuggerPresent()) {
- return !csbi.dwCursorPosition.X && !csbi.dwCursorPosition.Y;
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
+ ret0 = !csbi.dwCursorPosition.X && !csbi.dwCursorPosition.Y;
+ }
+
+ ret1 = GetConsoleProcessList(pl, 1) == 1;
+
+ return ret0 && ret1;
}
return FALSE;