summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-01-05 18:15:52 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-01-05 18:15:52 +0000
commit598e67f585e99a95a502cccb1dcbe6f00b47275b (patch)
tree7e961cff6efff9ee5baf98bd005de6f745a12e7d
parentab805277009ef2d197bacf44ed898e2ed947ac1c (diff)
When converting from terminfo to termcap, if we run out of space, nuke
acs_chars with extreme prejudice since it is usually quite long. This prevents tic from pruning some otherwise useful capabilities unless it really needs the space.
-rw-r--r--usr.bin/tic/dump_entry.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/tic/dump_entry.c b/usr.bin/tic/dump_entry.c
index 9d623580be1..1ad8d0b323c 100644
--- a/usr.bin/tic/dump_entry.c
+++ b/usr.bin/tic/dump_entry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump_entry.c,v 1.11 2000/01/02 21:48:13 millert Exp $ */
+/* $OpenBSD: dump_entry.c,v 1.12 2000/01/05 18:15:51 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2000 Free Software Foundation, Inc. *
@@ -769,13 +769,20 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int
if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
/*
* We pick on sgr because it's a nice long string capability that
- * is really just an optimization hack.
+ * is really just an optimization hack. Another good candidate is
+ * acsc since it is both long and unused by BSD termcap.
*/
char *oldsgr = set_attributes;
+ char *oldacsc = acs_chars;
set_attributes = ABSENT_STRING;
PRINTF("# (sgr removed to fit entry within %d bytes)\n",
critlen);
if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
+ acs_chars = ABSENT_STRING;
+ PRINTF("# (acsc removed to fit entry within %d bytes)\n",
+ critlen);
+ }
+ if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
int oldversion = tversion;
tversion = V_BSD;
@@ -795,6 +802,7 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int
tversion = oldversion;
}
set_attributes = oldsgr;
+ acs_chars = oldacsc;
}
}