summaryrefslogtreecommitdiff
path: root/src/stty.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-02-13 19:58:25 +0000
committerJim Meyering <jim@meyering.net>1994-02-13 19:58:25 +0000
commit1731098e4d91ef3187597031c2b1f9be60ed91ae (patch)
tree692cc16a7e65a4309a691b683861dce18c22ed06 /src/stty.c
parent380435c33b60786c4326a30b11ce520ec9549e6c (diff)
downloadcoreutils-1731098e4d91ef3187597031c2b1f9be60ed91ae.tar.xz
(set_window_size): Patch from Rick Sladkey.
Diffstat (limited to 'src/stty.c')
-rw-r--r--src/stty.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/stty.c b/src/stty.c
index 05e6b6521..58f20b7ba 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 <dupuy@cs.columbia.edu> 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.