mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
fix bugsnet #67212: phpdbg uses non-standard TIOCGWINSZ
This commit is contained in:
parent
fbb7bdc21e
commit
e9c2e7d6e6
@ -9,6 +9,7 @@ PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
|
||||
[ --enable-phpdbg-debug Build phpdbg in debug mode], no, no)
|
||||
|
||||
if test "$PHP_PHPDBG" != "no"; then
|
||||
AC_HEADER_TIOCGWINSZ
|
||||
AC_DEFINE(HAVE_PHPDBG, 1, [ ])
|
||||
|
||||
if test "$PHP_PHPDBG_DEBUG" != "no"; then
|
||||
|
@ -32,6 +32,9 @@
|
||||
# include "win32/time.h"
|
||||
#elif defined(HAVE_SYS_IOCTL_H)
|
||||
# include "sys/ioctl.h"
|
||||
# ifndef GWINSZ_IN_SYS_IOCTL
|
||||
# include <termios.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
|
||||
@ -437,7 +440,7 @@ PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
|
||||
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||
columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||
#elif defined(HAVE_SYS_IOCTL_H)
|
||||
#elif defined(HAVE_SYS_IOCTL_H) && defined (TIOCGWINSZ)
|
||||
struct winsize w;
|
||||
|
||||
columns = ioctl(fileno(stdout), TIOCGWINSZ, &w) == 0 ? w.ws_col : 80;
|
||||
|
Loading…
Reference in New Issue
Block a user