summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-20 16:25:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-20 16:25:16 +0000
commit6aca025fa3fd84708bc72dea2a80ba50206aac92 (patch)
treec92f90042887ba747bf3d7c04a07cb6cd9d08112 /usr.bin/less
parent511ddf28d7028235f2b77ded6449e44ff74a2935 (diff)
wrapping an ioctl for TIOCGWINSZ inside #ifdef TIOCGWINSIZE (entirely
different) makes no sense; instead, accept all modern systems have TIOCGWINSZ.
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/screen.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.bin/less/screen.c b/usr.bin/less/screen.c
index 5170e116cb8..4076935d71d 100644
--- a/usr.bin/less/screen.c
+++ b/usr.bin/less/screen.c
@@ -171,27 +171,19 @@ static int hardcopy;
static void
scrsize(void)
{
- char *s;
- int sys_height;
- int sys_width;
- int n;
-#ifdef TIOCGWINSIZE
+ int sys_height = 0, sys_width = 0, n;
struct winsize w;
-#endif
+ char *s;
#define DEF_SC_WIDTH 80
#define DEF_SC_HEIGHT 24
- sys_width = sys_height = 0;
-
-#ifdef TIOCGWINSIZE
if (ioctl(2, TIOCGWINSZ, &w) == 0) {
if (w.ws_row > 0)
sys_height = w.ws_row;
if (w.ws_col > 0)
sys_width = w.ws_col;
}
-#endif
if (sys_height > 0)
sc_height = sys_height;