aboutsummaryrefslogtreecommitdiff
path: root/libbb/xfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r--libbb/xfuncs.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 06bba0fe3..3d0bec7ac 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -625,26 +625,7 @@ void selinux_or_die(void)
625 625
626/* It is perfectly ok to pass in a NULL for either width or for 626/* It is perfectly ok to pass in a NULL for either width or for
627 * height, in which case that value will not be set. */ 627 * height, in which case that value will not be set. */
628#ifdef __MINGW32__ 628#ifndef __MINGW32__
629#include <windows.h>
630int get_terminal_width_height(const int fd, int *width, int *height)
631{
632 HANDLE console;
633 CONSOLE_SCREEN_BUFFER_INFO sbi;
634
635 console = GetStdHandle(STD_OUTPUT_HANDLE);
636 if (console == INVALID_HANDLE_VALUE || !console)
637 return -1;
638
639 GetConsoleScreenBufferInfo(console, &sbi);
640
641 if (width)
642 *width = sbi.srWindow.Right - sbi.srWindow.Left;
643 if (height)
644 *height = sbi.srWindow.Bottom - sbi.srWindow.Top;
645 return 0;
646}
647#else
648int get_terminal_width_height(const int fd, int *width, int *height) 629int get_terminal_width_height(const int fd, int *width, int *height)
649{ 630{
650 struct winsize win = { 0, 0, 0, 0 }; 631 struct winsize win = { 0, 0, 0, 0 };