aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-02-20 10:41:31 +0000
committerRon Yorston <rmy@pobox.com>2012-02-20 10:41:31 +0000
commitc6ff39ccc4e52fb860f2bfe436c5ac1c114aadd7 (patch)
treef81e95d16640882bd35202370626b1a0808343f7 /libbb
parent6fe28f11f83d489e8f5904a75a90008ca94c1437 (diff)
downloadbusybox-w32-c6ff39ccc4e52fb860f2bfe436c5ac1c114aadd7.tar.gz
busybox-w32-c6ff39ccc4e52fb860f2bfe436c5ac1c114aadd7.tar.bz2
busybox-w32-c6ff39ccc4e52fb860f2bfe436c5ac1c114aadd7.zip
Add code to find console dimensions in WIN32
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)