summaryrefslogtreecommitdiffstats
path: root/hack
diff options
context:
space:
mode:
authorchuck <chuck@NetBSD.org>2007-01-17 02:35:28 +0000
committerchuck <chuck@NetBSD.org>2007-01-17 02:35:28 +0000
commitec757acff77108e4e82f339f042fc100841d4945 (patch)
tree568ea43f848622275ae408927132ae7182ced8f1 /hack
parente8b954d043d637440a4562047829a3163cf64530 (diff)
downloadbsdgames-darwin-ec757acff77108e4e82f339f042fc100841d4945.tar.gz
bsdgames-darwin-ec757acff77108e4e82f339f042fc100841d4945.tar.zst
bsdgames-darwin-ec757acff77108e4e82f339f042fc100841d4945.zip
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().
Diffstat (limited to 'hack')
-rw-r--r--hack/hack.termcap.c13
1 files changed, 8 insertions, 5 deletions
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 <sys/cdefs.h>
#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 <string.h>
@@ -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 */
}