diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-06 02:13:32 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-12-06 02:13:32 +0000 |
commit | 93f153c898a0b816862eaf10532cbb586e2a293a (patch) | |
tree | e6a03fea329db52a28a56276db9d3ff1960d21f8 /lib/libcurses/tinfo | |
parent | 4919495250b016635daa63d27059ea2a2bc1b323 (diff) |
update to ncurses-5.0-19991204
Diffstat (limited to 'lib/libcurses/tinfo')
-rw-r--r-- | lib/libcurses/tinfo/captoinfo.c | 8 | ||||
-rw-r--r-- | lib/libcurses/tinfo/write_entry.c | 31 |
2 files changed, 28 insertions, 11 deletions
diff --git a/lib/libcurses/tinfo/captoinfo.c b/lib/libcurses/tinfo/captoinfo.c index 74185ae0ccf..93035421b4c 100644 --- a/lib/libcurses/tinfo/captoinfo.c +++ b/lib/libcurses/tinfo/captoinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: captoinfo.c,v 1.3 1999/08/15 11:40:55 millert Exp $ */ +/* $OpenBSD: captoinfo.c,v 1.4 1999/12/06 02:12:46 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -96,7 +96,7 @@ #include <ctype.h> #include <tic.h> -MODULE_ID("$From: captoinfo.c,v 1.24 1999/07/24 20:06:13 tom Exp $") +MODULE_ID("$From: captoinfo.c,v 1.25 1999/12/05 02:24:05 tom Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ #define MAX_ENTRY 2048 /* maximum chars in a translated capability */ @@ -601,6 +601,10 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ str++; --str; } + else if (str[0] == '%' && str[1] == '%') /* escaped '%' */ + { + bufptr = save_string(bufptr, "%%"); + } else if (*str != '%' || (parametrized < 1)) bufptr = save_char(bufptr, *str); else if (sscanf(str, "%%?%%{%d}%%>%%t%%{%d}%%+%%;", &c1,&c2) == 2) diff --git a/lib/libcurses/tinfo/write_entry.c b/lib/libcurses/tinfo/write_entry.c index e4dea953ffb..60f95451505 100644 --- a/lib/libcurses/tinfo/write_entry.c +++ b/lib/libcurses/tinfo/write_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: write_entry.c,v 1.4 1999/07/11 14:10:11 millert Exp $ */ +/* $OpenBSD: write_entry.c,v 1.5 1999/12/06 02:12:46 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -56,7 +56,7 @@ #define TRACE_OUT(p) /*nothing*/ #endif -MODULE_ID("$From: write_entry.c,v 1.47 1999/07/10 20:29:22 tom Exp $") +MODULE_ID("$From: write_entry.c,v 1.48 1999/12/04 23:02:59 tom Exp $") static int total_written; @@ -405,28 +405,41 @@ size_t i; short nextfree; short offsets[MAX_ENTRY_SIZE/2]; unsigned char buf[MAX_ENTRY_SIZE]; +unsigned last_bool = BOOLWRITE; +unsigned last_num = NUMWRITE; +unsigned last_str = STRWRITE; + +#if NCURSES_XNAMES + /* + * Normally we limit the list of values to exclude the "obsolete" + * capabilities. However, if we are accepting extended names, add + * these as well, since they are used for supporting translation + * to/from termcap. + */ + if (_nc_user_definable) { + last_bool = BOOLCOUNT; + last_num = NUMCOUNT; + last_str = STRCOUNT; + } +#endif namelist = tp->term_names; namelen = strlen(namelist) + 1; - /* - * BOOLWRITE, etc., are less than BOOLCOUNT because we store some - * values internally. - */ boolmax = 0; - for (i = 0; i < BOOLWRITE; i++) { + for (i = 0; i < last_bool; i++) { if (tp->Booleans[i]) boolmax = i+1; } nummax = 0; - for (i = 0; i < NUMWRITE; i++) { + for (i = 0; i < last_num; i++) { if (tp->Numbers[i] != ABSENT_NUMERIC) nummax = i+1; } strmax = 0; - for (i = 0; i < STRWRITE; i++) { + for (i = 0; i < last_str; i++) { if (tp->Strings[i] != ABSENT_STRING) strmax = i+1; } |