Create TERMCAP entries limited to 1023 bytes by default.
TERMCAP_BUF defaults to 1023 to create TERMCAP entries that work on
most systems. To save space, TERMCAP is unwrapped, and vt220 extra
keys are skipped (unless TERMCAP_BUF > 1023); navigation keys are
still included. Entries larger than TERMCAP_BUF are now truncated,
and no longer Panic screen.
Termcap entries are still wrapped when saved to a file.
Fixes screen bug: https://savannah.gnu.org/bugs/?55482
Signed-off-by: Scott Shambarger <devel@shambarger.net>
@@ -235,6 +235,7 @@ extern int StuffKey __P((int));
extern int InitTermcap __P((int, int));
extern char *MakeTermcap __P((int));
+extern void DumpTermcap __P((int, FILE *));
extern char *gettermcapstring __P((char *));
extern int remap __P((int, int));
@@ -479,10 +479,7 @@ void WriteFile(struct acluser *user, char *fn, int dump) {
- if ((p = index(MakeTermcap(fore->w_aflag), '=')) != NULL) {
+ DumpTermcap(fore->w_aflag, f);
@@ -507,7 +507,7 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
-# define TERMCAP_BUFSIZE 2048
+# define TERMCAP_BUFSIZE 1023
@@ -197,6 +197,7 @@ struct term term[T_N] =
{ "F1", T_STR }, KMAPDEF("\033[23~")
{ "F2", T_STR }, KMAPDEF("\033[24~")
/* extra keys for vt220 (David.Leonard@it.uq.edu.au) */
@@ -75,11 +75,10 @@ char screenterm[MAXTERMLEN + 1]; /* new $TERM, usually "screen" */