=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/kdump.c,v retrieving revision 1.101 retrieving revision 1.102 diff -c -r1.101 -r1.102 *** src/usr.bin/kdump/kdump.c 2015/04/18 18:28:37 1.101 --- src/usr.bin/kdump/kdump.c 2015/07/19 02:52:35 1.102 *************** *** 1,4 **** ! /* $OpenBSD: kdump.c,v 1.101 2015/04/18 18:28:37 deraadt Exp $ */ /*- * Copyright (c) 1988, 1993 --- 1,4 ---- ! /* $OpenBSD: kdump.c,v 1.102 2015/07/19 02:52:35 deraadt Exp $ */ /*- * Copyright (c) 1988, 1993 *************** *** 164,169 **** --- 164,171 ---- static void sockoptlevelname(int); static void ktraceopname(int); + static int screenwidth; + int main(int argc, char *argv[]) { *************** *** 175,180 **** --- 177,192 ---- def_emul = current = &emulations[0]; /* native */ + if (screenwidth == 0) { + struct winsize ws; + + if (fancy && ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && + ws.ws_col > 8) + screenwidth = ws.ws_col; + else + screenwidth = 80; + } + while ((ch = getopt(argc, argv, "e:f:dHlm:nRp:Tt:xX")) != -1) switch (ch) { case 'e': *************** *** 1177,1195 **** showbuf(unsigned char *dp, size_t datalen) { int i, j; - static int screenwidth; int col = 0, width, bpl; unsigned char visbuf[5], *cp, c; - if (screenwidth == 0) { - struct winsize ws; - - if (fancy && ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && - ws.ws_col > 8) - screenwidth = ws.ws_col; - else - screenwidth = 80; - } if (iohex == 1) { putchar('\t'); col = 8; --- 1189,1197 ----