diff options
-rw-r--r-- | lib/libcurses/base/version.c | 5 | ||||
-rw-r--r-- | lib/libcurses/curses.h | 4 | ||||
-rw-r--r-- | lib/libcurses/curses.priv.h | 14 | ||||
-rw-r--r-- | lib/libcurses/tinfo/captoinfo.c | 8 | ||||
-rw-r--r-- | lib/libcurses/tinfo/write_entry.c | 31 |
5 files changed, 42 insertions, 20 deletions
diff --git a/lib/libcurses/base/version.c b/lib/libcurses/base/version.c index a8f78015cec..df07a6f9dc0 100644 --- a/lib/libcurses/base/version.c +++ b/lib/libcurses/base/version.c @@ -40,9 +40,8 @@ curses_version(void) static char my_version[80]; T((T_CALLED("curses_version()"))); - sprintf(my_version, "ncurses %d.%d.%d", - NCURSES_VERSION_MAJOR, - NCURSES_VERSION_MINOR, + sprintf(my_version, "ncurses %s.%d", + NCURSES_VERSION, NCURSES_VERSION_PATCH); returnPtr(my_version); } diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index 44844941c19..d524c426cb8 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.38 1999/11/28 17:53:40 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.39 1999/12/06 02:13:31 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR 5 #define NCURSES_VERSION_MINOR 0 -#define NCURSES_VERSION_PATCH 19991127 +#define NCURSES_VERSION_PATCH 19991204 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h index a4394c11b3f..02925ff0114 100644 --- a/lib/libcurses/curses.priv.h +++ b/lib/libcurses/curses.priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.priv.h,v 1.21 1999/11/28 17:53:40 millert Exp $ */ +/* $OpenBSD: curses.priv.h,v 1.22 1999/12/06 02:13:31 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ /* - * $From: curses.priv.h,v 1.147 1999/11/28 00:10:37 tom Exp $ + * $From: curses.priv.h,v 1.148 1999/12/04 18:09:40 tom Exp $ * * curses.priv.h * @@ -490,11 +490,17 @@ typedef struct { line->lastchar = end #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) + #define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) #define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type)) #define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type)) -#define FreeIfNeeded(p) if(p != 0) free(p) -#define FreeAndNull(p) free(p); p = 0; + +#define FreeIfNeeded(p) if ((p) != 0) free(p) + +/* FreeAndNull() is not a comma-separated expression because some compilers + * do not accept a mixture of void with values. + */ +#define FreeAndNull(p) free(p); p = 0 #include <nc_alloc.h> 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; } |