1 diff -u -r ../mdocml-1.14.1/term_ascii.c ./term_ascii.c
2 --- ../mdocml-1.14.1/term_ascii.c 2017-02-21 00:25:20.000000000 +0000
3 +++ ./term_ascii.c 2017-03-02 14:04:37.164590198 +0000
8 +#include <sys/ioctl.h>
22 p = mandoc_calloc(1, sizeof(struct termp));
26 p->defrmargin = p->lastrmargin = 78;
27 + if ((tfd = open("/dev/tty", O_RDWR, 0)) != -1) {
28 + if (ioctl(tfd, TIOCGWINSZ, &ws) != -1) {
30 + p->defrmargin = p->lastrmargin = ws.ws_col - 2;
35 p->fontq = mandoc_reallocarray(NULL,
36 (p->fontsz = 8), sizeof(enum termfont));
37 p->fontq[0] = p->fontl = TERMFONT_NONE;