From: Jim Meyering Date: Sun, 13 Feb 1994 19:58:25 +0000 (+0000) Subject: (set_window_size): Patch from Rick Sladkey. X-Git-Tag: textutils-1_12_1~754 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1731098e4d91ef3187597031c2b1f9be60ed91ae;p=thirdparty%2Fcoreutils.git (set_window_size): Patch from Rick Sladkey. --- diff --git a/src/stty.c b/src/stty.c index 05e6b65217..58f20b7ba1 100644 --- a/src/stty.c +++ b/src/stty.c @@ -1143,19 +1143,16 @@ set_window_size (rows, cols) { if (errno != EINVAL) error (1, errno, "standard input"); - win.ws_row = (rows >= 0 ? rows : 0); - win.ws_col = (cols >= 0 ? cols : 0); + bzero (&win, sizeof (win)); } - else - { if (rows >= 0) win.ws_row = rows; if (cols >= 0) win.ws_col = cols; - } #ifdef TIOCSSIZE - /* The following code deals with a bug in the SunOS 4.x (and 3.x?) kernel. + /* Alexander Dupuy wrote: + The following code deals with a bug in the SunOS 4.x (and 3.x?) kernel. This comment from sys/ttold.h describes Sun's twisted logic - a better test would have been (ts_lines > 64k || ts_cols > 64k || ts_cols == 0). At any rate, the problem is gone in Solaris 2.x.