aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index a02a504b0..53c48557d 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -256,7 +256,11 @@ int FAST_FUNC get_terminal_width_height(int fd, unsigned *width, unsigned *heigh
256 win.ws_col = 0; 256 win.ws_col = 0;
257 /* I've seen ioctl returning 0, but row/col is (still?) 0. 257 /* I've seen ioctl returning 0, but row/col is (still?) 0.
258 * We treat that as an error too. */ 258 * We treat that as an error too. */
259#if !ENABLE_PLATFORM_MINGW32
259 err = ioctl(fd, TIOCGWINSZ, &win) != 0 || win.ws_row == 0; 260 err = ioctl(fd, TIOCGWINSZ, &win) != 0 || win.ws_row == 0;
261#else
262 err = winansi_get_terminal_width_height(&win) == 0;
263#endif
260 if (height) 264 if (height)
261 *height = wh_helper(win.ws_row, 24, "LINES", &err); 265 *height = wh_helper(win.ws_row, 24, "LINES", &err);
262 if (width) 266 if (width)