=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/screen.c,v retrieving revision 1.23 retrieving revision 1.24 diff -c -r1.23 -r1.24 *** src/usr.bin/less/screen.c 2016/03/16 15:36:26 1.23 --- src/usr.bin/less/screen.c 2016/07/08 15:23:44 1.24 *************** *** 16,21 **** --- 16,22 ---- #include + #include #include #include *************** *** 266,271 **** --- 267,273 ---- { char *t1, *t2; char *term; + int err; /* * Find out what kind of terminal this is. *************** *** 274,281 **** term = DEFAULT_TERM; hardcopy = 0; ! if (setupterm(term, 1, NULL) < 0) { ! hardcopy = 1; } if (hard_copy == 1) hardcopy = 1; --- 276,286 ---- term = DEFAULT_TERM; hardcopy = 0; ! if (setupterm(term, 1, &err) < 0) { ! if (err == 1) ! hardcopy = 1; ! else ! errx(1, "%s: unknown terminal type", term); } if (hard_copy == 1) hardcopy = 1;