+ fixes for out-of-memory condition (report by "eaglegai").
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3967 2023/06/17 17:17:42 tom Exp $
+-- $Id: NEWS,v 1.3969 2023/06/24 22:59:35 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20230624
+ + fixes for out-of-memory condition (report by "eaglegai").
+
20230617
+ markup manpages with revision information (prompted by discussion
with Bjarni Ingi Gislason).
-5:0:10 6.4 20230617
+5:0:10 6.4 20230624
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1550 2023/06/17 09:47:23 tom Exp $
+# $Id: dist.mk,v 1.1551 2023/06/24 10:06:22 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 4
-NCURSES_PATCH = 20230617
+NCURSES_PATCH = 20230624
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2003-2006,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
****************************************************************************/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: key_defined.c,v 1.10 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: key_defined.c,v 1.11 2023/06/24 15:36:32 tom Exp $")
static int
find_definition(TRIES * tree, const char *str)
TRIES *ptr;
int result = OK;
- if (str != 0 && *str != '\0') {
+ if (VALID_STRING(str) && *str != '\0') {
for (ptr = tree; ptr != 0; ptr = ptr->sibling) {
if (UChar(*str) == UChar(ptr->ch)) {
if (str[1] == '\0' && ptr->child != 0) {
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
*/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: tries.c,v 1.31 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: tries.c,v 1.32 2023/06/24 15:36:23 tom Exp $")
/*
* Expand a keycode into the string that it corresponds to, returning null if
{
T((T_CALLED("_nc_remove_string(%p,%s)"), (void *) tree, _nc_visbuf(string)));
- if (string == 0 || *string == 0)
+ if (!VALID_STRING(string) || *string == 0)
returnCode(FALSE);
while (*tree != 0) {
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.669 2023/06/06 22:31:04 tom Exp $
+ * $Id: curses.priv.h,v 1.670 2023/06/24 13:00:26 tom Exp $
*
* curses.priv.h
*
#define SET_SCREEN_PAIR(s,p) SetPair(SCREEN_ATTRS(s), p)
#if USE_REENTRANT || NCURSES_SP_FUNCS
-NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *);
-NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *);
-NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *);
-NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *);
#endif
#if USE_REENTRANT
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
+#include <nc_alloc.h>
+#include <nc_access.h>
+
#define FreeIfNeeded(p) if ((p) != 0) free(p)
/* FreeAndNull() is not a comma-separated expression because some compilers
*/
#define FreeAndNull(p) do { free(p); p = 0; } while (0)
-#include <nc_alloc.h>
-#include <nc_access.h>
+#ifdef EXP_OOM_TESTING
+extern NCURSES_EXPORT(void *) _nc_oom_malloc(size_t size);
+extern NCURSES_EXPORT(void *) _nc_oom_calloc(size_t nmemb, size_t size);
+extern NCURSES_EXPORT(void *) _nc_oom_realloc(void *ptr, size_t size);
+extern NCURSES_EXPORT(void) _nc_oom_free(void *ptr);
+extern NCURSES_EXPORT(char *) _nc_oom_strdup(const char *ptr);
+#define malloc(size) _nc_oom_malloc(size)
+#define calloc(nmemb, size) _nc_oom_calloc(nmemb, size)
+#define realloc(ptr, size) _nc_oom_realloc(ptr, size)
+#define free(ptr) _nc_oom_free(ptr)
+#define strdup(ptr) _nc_oom_strdup(ptr)
+#endif
/*
* Use these for tic/infocmp malloc failures. Generally the ncurses library
/* lib_addch.c */
#if USE_WIDEC_SUPPORT
-NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
+extern NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
#endif
/* lib_addstr.c */
#define _nc_fallback2(tp) _nc_fallback(tp)
#endif
-NCURSES_EXPORT(void) _nc_copy_termtype(TERMTYPE *, const TERMTYPE *);
+extern NCURSES_EXPORT(void) _nc_copy_termtype(TERMTYPE *, const TERMTYPE *);
#if NCURSES_EXT_NUMBERS
extern NCURSES_EXPORT(void) _nc_copy_termtype2 (TERMTYPE2 *, const TERMTYPE2 *);
#if defined(_NC_WINDOWS) || defined(_NC_MINGW)
/* see wcwidth.c */
-NCURSES_EXPORT(int) mk_wcwidth(wchar_t);
+extern NCURSES_EXPORT(int) mk_wcwidth(wchar_t);
#define wcwidth(ucs) _nc_wcwidth(ucs)
#endif
#endif
#ifdef EXP_XTERM_1005
-NCURSES_EXPORT(int) _nc_conv_to_utf8(unsigned char *, unsigned, unsigned);
-NCURSES_EXPORT(int) _nc_conv_to_utf32(unsigned *, const char *, unsigned);
+extern NCURSES_EXPORT(int) _nc_conv_to_utf8(unsigned char *, unsigned, unsigned);
+extern NCURSES_EXPORT(int) _nc_conv_to_utf32(unsigned *, const char *, unsigned);
#endif
#ifdef __cplusplus
#include <tic.h>
-MODULE_ID("$Id: access.c,v 1.36 2023/04/22 21:19:56 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.37 2023/06/24 21:55:09 tom Exp $")
#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
static char *temp;
char *s;
- temp = strdup(result);
- result = temp;
+ if ((temp = strdup(result)) != 0)
+ result = temp;
#if !MIXEDCASE_FILENAMES
for (s = result; *s != '\0'; ++s) {
*s = (char) LOWERCASE(*s);
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
*/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: add_tries.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: add_tries.c,v 1.13 2023/06/24 15:36:13 tom Exp $")
#define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0'
#define CMP_TRY(a,b) ((a)? (a == b) : (b == 128))
T((T_CALLED("_nc_add_to_try(%p, %s, %u)"),
(void *) *tree, _nc_visbuf(str), code));
- if (txt == 0 || *txt == '\0' || code == 0)
+ if (!VALID_STRING(str) || *txt == '\0' || code == 0)
returnCode(ERR);
if ((*tree) != 0) {
#include <tic.h>
#include <hashsize.h>
-MODULE_ID("$Id: comp_hash.c,v 1.54 2023/04/22 15:12:57 tom Exp $")
+MODULE_ID("$Id: comp_hash.c,v 1.55 2023/06/24 13:29:43 tom Exp $")
/*
* Finds the entry for the given string in the hash table if present.
&& data->table_data[hashvalue] >= 0) {
const struct name_table_entry *const table = _nc_get_table(termcap);
- ptr = table + data->table_data[hashvalue];
- while (ptr->nte_type != type
- || !data->compare_names(ptr->nte_name, string)) {
- if (ptr->nte_link < 0) {
- ptr = 0;
- break;
+ if (table != NULL) {
+ ptr = table + data->table_data[hashvalue];
+ while (ptr->nte_type != type
+ || !data->compare_names(ptr->nte_name, string)) {
+ if (ptr->nte_link < 0) {
+ ptr = 0;
+ break;
+ }
+ ptr = table + (ptr->nte_link + data->table_data[data->table_size]);
}
- ptr = table + (ptr->nte_link + data->table_data[data->table_size]);
}
}
/****************************************************************************
- * Copyright 2018-2020,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2006-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: db_iterator.c,v 1.49 2022/04/23 20:03:15 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.50 2023/06/24 21:52:32 tom Exp $")
#define HaveTicDirectory _nc_globals.have_tic_directory
#define KeepTicDirectory _nc_globals.keep_tic_directory
*/
for (j = 0; my_list[j] != 0; ++j) {
#ifdef TERMINFO
- if (*my_list[j] == '\0')
- my_list[j] = strdup(TERMINFO);
+ if (*my_list[j] == '\0') {
+ char *my_copy = strdup(TERMINFO);
+ if (my_copy != 0)
+ my_list[j] = my_copy;
+ }
#endif
trim_formatting(my_list[j]);
for (k = 0; k < j; ++k) {
/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.218 2022/08/13 18:12:22 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.219 2023/06/24 13:25:14 tom Exp $")
/****************************************************************************
*
#endif
}
myname = strdup(tname);
-
- if (strlen(myname) > MAX_NAME_SIZE) {
+ if (myname == NULL || strlen(myname) > MAX_NAME_SIZE) {
ret_error(TGETENT_ERR,
- "TERM environment must be <= %d characters.\n",
+ "TERM environment must be 1..%d characters.\n",
MAX_NAME_SIZE,
free(myname));
}
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: lib_tparm.c,v 1.146 2023/04/23 20:57:33 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.150 2023/06/24 16:12:52 tom Exp $")
/*
* char *
#if HAVE_TSEARCH
if (MyCount != 0) {
delete_tparm = typeCalloc(TPARM_DATA *, MyCount);
- which_tparm = 0;
- twalk(MyCache, visit_nodes);
- for (which_tparm = 0; which_tparm < MyCount; ++which_tparm) {
- TPARM_DATA *ptr = delete_tparm[which_tparm];
- if (ptr != NULL) {
- tdelete(ptr, &MyCache, cmp_format);
- free((char *) ptr->format);
- free(ptr);
+ if (delete_tparm != NULL) {
+ which_tparm = 0;
+ twalk(MyCache, visit_nodes);
+ for (which_tparm = 0; which_tparm < MyCount; ++which_tparm) {
+ TPARM_DATA *ptr = delete_tparm[which_tparm];
+ if (ptr != NULL) {
+ tdelete(ptr, &MyCache, cmp_format);
+ free((char *) ptr->format);
+ free(ptr);
+ }
}
+ which_tparm = 0;
+ twalk(MyCache, visit_nodes);
+ FreeAndNull(delete_tparm);
}
- which_tparm = 0;
- twalk(MyCache, visit_nodes);
- FreeAndNull(delete_tparm);
MyCount = 0;
which_tparm = 0;
}
tparm_trace_call(tps, string, data);
+ if (TPS(fmt_buff) == NULL) {
+ T((T_RETURN("<null>")));
+ return NULL;
+ }
+
while ((cp - string) < (int) len2) {
if (*cp != '%') {
save_char(tps, UChar(*cp));
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2013-2014,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: obsolete.c,v 1.6 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: obsolete.c,v 1.9 2023/06/24 22:02:25 tom Exp $")
/*
* Obsolete entrypoint retained for binary compatibility.
#undef CH
}
#endif /* EXP_XTERM_1005 */
+
+#ifdef EXP_OOM_TESTING
+/*
+ * Out-of-memory testing, suitable for checking if initialization (and limited
+ * running) recovers from errors due to insufficient memory. In practice, this
+ * is unlikely except with artifically constructed tests (or poorly behaved
+ * applications).
+ */
+#undef malloc
+#undef calloc
+#undef realloc
+#undef free
+#undef strdup
+
+static long oom_limit = -1;
+static long oom_count = 0;
+
+static bool
+oom_check(void)
+{
+ static bool initialized = FALSE;
+ static bool triggered = FALSE;
+ bool result = FALSE;
+
+ if (!initialized) {
+ char *env = getenv("NCURSES_OOM_TESTING");
+ initialized = TRUE;
+ if (env != NULL) {
+ char *check;
+ oom_limit = strtol(env, &check, 0);
+ if (check != NULL && *check != '\0')
+ oom_limit = 0;
+ }
+ }
+ if (oom_limit >= 0) {
+ result = (++oom_count > oom_limit);
+ if (result && !triggered) {
+ triggered = TRUE;
+ T(("out-of-memory"));
+ }
+ }
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_malloc(size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : malloc(size));
+ T(("oom #%ld malloc(%ld) %p", oom_count, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_calloc(size_t nmemb, size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : calloc(nmemb, size));
+ T(("oom #%ld calloc(%ld, %ld) %p", oom_count, nmemb, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_realloc(void *ptr, size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : realloc(ptr, size));
+ T(("oom #%ld realloc(%p, %ld) %p", oom_count, ptr, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void)
+_nc_oom_free(void *ptr)
+{
+ T(("oom #%ld free(%p)", oom_count, ptr));
+ free(ptr);
+}
+
+NCURSES_EXPORT(char *)
+_nc_oom_strdup(const char *ptr)
+{
+ char *result = (oom_check()
+ ? NULL
+ : strdup(ptr));
+ T(("oom #%ld strdup(%p) %p", oom_count, ptr, result));
+ return result;
+}
+#endif /* EXP_OOM_TESTING */
#include <tic.h>
-MODULE_ID("$Id: read_entry.c,v 1.169 2023/06/15 20:51:06 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.170 2023/06/24 18:09:05 tom Exp $")
#define MyNumber(n) (short) LOW_MSB(n)
int reccnt = 0;
char *save = strdup(name);
+ if (save == 0)
+ returnDB(code);
+
memset(&key, 0, sizeof(key));
key.data = save;
key.size = strlen(save);
#include <sys/types.h>
#include <tic.h>
-MODULE_ID("$Id: read_termcap.c,v 1.103 2023/04/28 20:59:14 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.104 2023/06/24 21:53:16 tom Exp $")
#if !PURE_TERMINFO
if (normal) { /* normal case */
char envhome[PATH_MAX], *h;
- copied = strdup(get_termpath());
- for (cp = copied; *cp; cp++) {
- if (*cp == NCURSES_PATHSEP)
- *cp = '\0';
- else if (cp == copied || cp[-1] == '\0') {
- ADD_TC(cp, filecount);
+ if ((copied = strdup(get_termpath())) != 0) {
+ for (cp = copied; *cp; cp++) {
+ if (*cp == NCURSES_PATHSEP)
+ *cp = '\0';
+ else if (cp == copied || cp[-1] == '\0') {
+ ADD_TC(cp, filecount);
+ }
}
}
-
#define PRIVATE_CAP "%.*s/.termcap"
if (use_terminfo_vars() && (h = getenv("HOME")) != NULL && *h != '\0'
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_tracedmp.c,v 1.36 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.37 2023/06/24 15:49:45 tom Exp $")
#ifdef TRACE
if (++width + 1 > (int) my_length) {
my_length = (unsigned) (2 * (width + 1));
my_buffer = typeRealloc(char, my_length, my_buffer);
- if (my_buffer == 0)
- return;
}
+ if (my_buffer == 0)
+ return;
for (n = 0; n <= win->_maxy; ++n) {
char *ep = my_buffer;
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: trace_buf.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: trace_buf.c,v 1.22 2023/06/24 13:37:25 tom Exp $")
#ifdef TRACE
NCURSES_EXPORT(char *)
_nc_trace_bufcat(int bufnum, const char *value)
{
- char *buffer = _nc_trace_alloc(bufnum, (size_t) 0);
+ char *buffer;
+
+ if (value == NULL)
+ value = "";
+ buffer = _nc_trace_alloc(bufnum, (size_t) 0);
if (buffer != 0) {
size_t have = strlen(buffer);
size_t need = strlen(value) + have;
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2001-2008,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <ctype.h>
-MODULE_ID("$Id: varargs.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: varargs.c,v 1.13 2023/06/24 13:41:46 tom Exp $")
#ifdef TRACE
NCURSES_EXPORT(char *)
_nc_varargs(const char *fmt, va_list ap)
{
- static char dummy[] = "";
-
char buffer[BUFSIZ];
const char *param;
int n;
if (fmt == 0 || *fmt == '\0')
- return dummy;
+ return NULL;
if (MyLength == 0)
MyBuffer = typeMalloc(char, MyLength = BUFSIZ);
if (MyBuffer == 0)
- return dummy;
+ return NULL;
*MyBuffer = '\0';
while (*fmt != '\0') {
}
}
- return (MyBuffer ? MyBuffer : dummy);
+ return (MyBuffer ? MyBuffer : NULL);
}
#else
EMPTY_MODULE(_nc_varargs)
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: hardscroll.c,v 1.54 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.56 2023/06/24 22:55:24 tom Exp $")
#if defined(SCROLLDEBUG) || defined(HASHDEBUG)
int *new_oldnums = typeRealloc(int,
(size_t) need_lines,
oldnums(SP_PARM));
- if (!new_oldnums)
+ if (!new_oldnums) {
+ TR(TRACE_ICALLS, (T_RETURN("")));
return;
+ }
oldnums(SP_PARM) = new_oldnums;
OLDNUM_SIZE(SP_PARM) = need_lines;
}
/* calculate the indices */
NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG);
+ if (SP_PARM->hashtab_len < screen_lines(SP_PARM)) {
+ TR(TRACE_ICALLS, (T_RETURN("")));
+ return;
+ }
#endif
#endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */
/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_mvcur.c,v 1.157 2022/08/20 18:28:58 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.158 2023/06/24 17:34:43 tom Exp $")
#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */
* and the time the structure WANT_CHAR would access has been
* updated.
*/
- if (ovw) {
+ if (ovw && to_y >= 0) {
int i;
for (i = 0; i < n; i++) {
}
}
}
- if (ovw) {
+ if (ovw && to_y >= 0) {
int i;
for (i = 0; i < n; i++)
-ncurses6 (6.4+20230617) unstable; urgency=low
+ncurses6 (6.4+20230624) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Jun 2023 05:47:23 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Jun 2023 06:06:22 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230617) unstable; urgency=low
+ncurses6 (6.4+20230624) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Jun 2023 05:47:23 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Jun 2023 06:06:22 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230617) unstable; urgency=low
+ncurses6 (6.4+20230624) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Jun 2023 05:47:23 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Jun 2023 06:06:22 -0400
ncurses6 (5.9+20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.590 2023/06/17 09:47:23 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.591 2023/06/24 10:06:22 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "4"\r
!define VERSION_YYYY "2023"\r
-!define VERSION_MMDD "0617"\r
+!define VERSION_MMDD "0624"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.4
-Release: 20230617
+Release: 20230624
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.4
-Release: 20230617
+Release: 20230624
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.4
-Release: 20230617
+Release: 20230624
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
/****************************************************************************
- * Copyright 2018-2020,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2002-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_defkey.c,v 1.33 2022/12/10 23:31:31 tom Exp $
+ * $Id: demo_defkey.c,v 1.34 2023/06/24 15:37:17 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2002/11/23
{
char *result = 0;
- if (string != 0 && *string != '\0') {
+ if (VALID_STRING(string) && *string != '\0') {
int pass;
int n;
size_t need = 1;
{
char *value = tigetstr(name);
- if (value != 0) {
+ if (VALID_STRING(value)) {
const char *prefix = 0;
if (!(strncmp) (value, "\033[", (size_t) 2)) {
/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: list_keys.c,v 1.31 2022/12/10 23:23:27 tom Exp $
+ * $Id: list_keys.c,v 1.32 2023/06/24 13:57:11 tom Exp $
*
* Author: Thomas E Dickey
*
#define Type(n) list[n].type
#define Name(n) list[n].name
+static void
+failed(const char *msg)
+{
+ perror(msg);
+ ExitProgram(EXIT_FAILURE);
+}
+
static const char *
full_name(const char *name)
{
widths1 = (int) strlen(modifier);
for (k = 0; k < count; ++k) {
+ char *value;
set_curterm(terms[k]);
- check = (int) strlen(termname());
+ if ((value = termname()) == NULL)
+ failed("termname");
+ check = (int) strlen(value);
if (widths2 < check)
widths2 = check;
}
/****************************************************************************
- * Copyright 2019-2020,2022 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
****************************************************************************/
/*
- * $Id: sp_tinfo.c,v 1.28 2022/12/10 23:23:27 tom Exp $
+ * $Id: sp_tinfo.c,v 1.29 2023/06/24 14:14:56 tom Exp $
*
* TOTO: add option for non-sp-funcs interface
*/
do_stuff(my_out);
do_stuff(my_err);
- cleanup(my_out);
- cleanup(my_err);
+ if (my_out != my_err) {
+ cleanup(my_out);
+ cleanup(my_err);
+ } else {
+ cleanup(my_out);
+ }
ExitProgram(EXIT_SUCCESS);
}
/****************************************************************************
- * Copyright 2020,2022 Thomas E. Dickey *
+ * Copyright 2020-2022,2023 Thomas E. Dickey *
* Copyright 2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
/*
* Author: Thomas E. Dickey
*
- * $Id: test_setupterm.c,v 1.16 2022/12/10 23:23:27 tom Exp $
+ * $Id: test_setupterm.c,v 1.17 2023/06/24 14:19:52 tom Exp $
*
* A simple demo of setupterm/restartterm.
*/
static size_t num_saved;
static size_t max_saved;
+static void
+failed(const char *msg)
+{
+ perror(msg);
+ ExitProgram(EXIT_FAILURE);
+}
+
static void
finish(int code)
{
if (num_saved + 1 >= max_saved) {
max_saved += 100;
saved_terminals = typeRealloc(TERMINAL *, max_saved, saved_terminals);
+ if (saved_terminals == NULL)
+ failed("realloc");
}
saved_terminals[num_saved++] = cur_term;
}