1 diff -u -r ../mandoc-1.14.3/term_ascii.c ./term_ascii.c
2 --- ../mandoc-1.14.3/term_ascii.c 2017-08-05 14:40:22.000000000 +0200
3 +++ ./term_ascii.c 2017-08-17 15:58:09.579116114 +0200
8 +#include <sys/ioctl.h>
22 p = mandoc_calloc(1, sizeof(*p));
23 p->tcol = p->tcols = mandoc_calloc(1, sizeof(*p->tcol));
27 p->defrmargin = p->lastrmargin = 78;
29 + if ((tfd = open("/dev/tty", O_RDWR, 0)) != -1) {
30 + if (ioctl(tfd, TIOCGWINSZ, &ws) != -1) {
32 + p->defrmargin = p->lastrmargin = ws.ws_col - 2;
37 p->fontq = mandoc_reallocarray(NULL,
38 (p->fontsz = 8), sizeof(*p->fontq));
39 p->fontq[0] = p->fontl = TERMFONT_NONE;