=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/screen.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/top/screen.c 2017/03/15 04:24:14 1.21 --- src/usr.bin/top/screen.c 2019/10/08 07:26:59 1.22 *************** *** 1,4 **** ! /* $OpenBSD: screen.c,v 1.21 2017/03/15 04:24:14 deraadt Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: screen.c,v 1.22 2019/10/08 07:26:59 kn Exp $ */ /* * Top users/processes display for Unix *************** *** 46,62 **** #include #include #include #include "top.h" #include "screen.h" #include "layout.h" - #include "boolean.h" int screen_length, screen_width; char ch_erase, ch_kill, smart_terminal; static struct termios old_settings, new_settings; ! static char is_a_terminal = No; void init_termcap(int interactive) --- 46,62 ---- #include #include #include + #include #include "top.h" #include "screen.h" #include "layout.h" int screen_length, screen_width; char ch_erase, ch_kill, smart_terminal; static struct termios old_settings, new_settings; ! static char is_a_terminal = false; void init_termcap(int interactive) *************** *** 70,80 **** if (!interactive) { /* pretend we have a dumb terminal */ ! smart_terminal = No; return; } /* assume we have a smart terminal until proven otherwise */ ! smart_terminal = Yes; /* get the terminal name */ term_name = getenv("TERM"); --- 70,80 ---- if (!interactive) { /* pretend we have a dumb terminal */ ! smart_terminal = false; return; } /* assume we have a smart terminal until proven otherwise */ ! smart_terminal = true; /* get the terminal name */ term_name = getenv("TERM"); *************** *** 82,88 **** /* if there is no TERM, assume it's a dumb terminal */ /* patch courtesy of Sam Horrocks at telegraph.ics.uci.edu */ if (term_name == NULL) { ! smart_terminal = No; return; } --- 82,88 ---- /* if there is no TERM, assume it's a dumb terminal */ /* patch courtesy of Sam Horrocks at telegraph.ics.uci.edu */ if (term_name == NULL) { ! smart_terminal = false; return; } *************** *** 94,106 **** warnx("no termcap entry for a `%s' terminal", term_name); /* pretend it's dumb and proceed */ ! smart_terminal = No; return; } /* "hardcopy" immediately indicates a very stupid terminal */ if (tgetflag("hc")) { ! smart_terminal = No; return; } --- 94,106 ---- warnx("no termcap entry for a `%s' terminal", term_name); /* pretend it's dumb and proceed */ ! smart_terminal = false; return; } /* "hardcopy" immediately indicates a very stupid terminal */ if (tgetflag("hc")) { ! smart_terminal = false; return; } *************** *** 118,124 **** /* get necessary capabilities */ if (tgetstr("cl", NULL) == NULL || tgetstr("cm", NULL) == NULL) { ! smart_terminal = No; return; } --- 118,124 ---- /* get necessary capabilities */ if (tgetstr("cl", NULL) == NULL || tgetstr("cm", NULL) == NULL) { ! smart_terminal = false; return; } *************** *** 131,137 **** /* if stdout is not a terminal, pretend we are a dumb terminal */ if (tcgetattr(STDOUT_FILENO, &old_settings) == -1) ! smart_terminal = No; } void --- 131,137 ---- /* if stdout is not a terminal, pretend we are a dumb terminal */ if (tcgetattr(STDOUT_FILENO, &old_settings) == -1) ! smart_terminal = false; } void *************** *** 152,158 **** ch_erase = old_settings.c_cc[VERASE]; ch_kill = old_settings.c_cc[VKILL]; ! is_a_terminal = Yes; #if 0 /* send the termcap initialization string */ putcap(terminal_init); --- 152,158 ---- ch_erase = old_settings.c_cc[VERASE]; ch_kill = old_settings.c_cc[VKILL]; ! is_a_terminal = true; #if 0 /* send the termcap initialization string */ putcap(terminal_init); *************** *** 160,166 **** } if (!is_a_terminal) { /* not a terminal at all---consider it dumb */ ! smart_terminal = No; } if (smart_terminal) --- 160,166 ---- } if (!is_a_terminal) { /* not a terminal at all---consider it dumb */ ! smart_terminal = false; } if (smart_terminal)