From ec757acff77108e4e82f339f042fc100841d4945 Mon Sep 17 00:00:00 2001 From: chuck Date: Wed, 17 Jan 2007 02:35:28 +0000 Subject: Update my previous commit to better match the original code, including the check for 'bs'... my previous commit should have included the following text: fixes problem introduced in 1.13 where the setting of "BC" (backspace char) was left to libterm rather than being done by hack itself. the problem with this was that hack was directly setting BC to \b if there was no "bc" in the termcap entry, but libterm does not do this. this resulted in the xputs(BC) calls in nocmov() and backsp() incorrectly doing nothing, thus messing up the display. added new var BC_BS to provide the old behavior for nocmov() and backsp(). --- hack/hack.termcap.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'hack') diff --git a/hack/hack.termcap.c b/hack/hack.termcap.c index a69f7e69..edfa8a01 100644 --- a/hack/hack.termcap.c +++ b/hack/hack.termcap.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.termcap.c,v 1.14 2007/01/17 02:12:19 chuck Exp $ */ +/* $NetBSD: hack.termcap.c,v 1.15 2007/01/17 02:35:28 chuck Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.termcap.c,v 1.14 2007/01/17 02:12:19 chuck Exp $"); +__RCSID("$NetBSD: hack.termcap.c,v 1.15 2007/01/17 02:35:28 chuck Exp $"); #endif /* not lint */ #include @@ -94,6 +94,12 @@ startup() flags.nonull = 1; /* this should be a termcap flag */ if (t_getent(&info, term) < 1) error("Unknown terminal type: %s.", term); + BC_BS = t_agetstr(info, "bc"); + if (!BC_BS) { + if (!t_getflag(info, "bs")) + error("Terminal must backspace."); + BC_BS = "\b"; + } HO = t_agetstr(info, "ho"); CO = t_getnum(info, "co"); LI = t_getnum(info, "li"); @@ -125,9 +131,6 @@ startup() if (!SO || !SE || (SG > 0)) SO = SE = 0; CD = t_agetstr(info, "cd"); - BC_BS = t_agetstr(info, "bc"); - if (!BC_BS) - BC_BS = "\b"; set_whole_screen(); /* uses LI and CD */ } -- cgit v1.2.3-56-ge451