-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3945 2023/04/24 22:48:50 tom Exp $
+-- $Id: NEWS,v 1.3948 2023/04/29 20:33:12 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.
+20230429
+ + revise recent change to _nc_write_entry to isolate it to a Cygwin bug
+ (cf: 20230311)
+ + amend fix for wgetnstr, wgetn_wstr to use cbreak mode unless raw
+ mode was set (cf: 20210522).
+ + fix a few warnings from cppcheck, etc.
+ + correct copy/paste error in nc_access.h (report by Werner Fink).
+
20230424
+ check return value of _nc_save_str(), in special case for tic where
extended capabilities are processed but the terminal description was
-5:0:10 6.4 20230424
+5:0:10 6.4 20230429
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1540 2023/04/24 22:49:54 tom Exp $
+# $Id: dist.mk,v 1.1541 2023/04/29 10:21:08 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 = 20230424
+NCURSES_PATCH = 20230429
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
* authorization. *
****************************************************************************/
-/* $Id: nc_access.h,v 1.4 2023/04/22 20:32:13 tom Exp $ */
+/* $Id: nc_access.h,v 1.5 2023/04/28 20:04:43 tom Exp $ */
#ifndef NC_ACCESS_included
#define NC_ACCESS_included 1
*/
#ifdef USE_ROOT_ACCESS
-#define safe_fopen(name,mode) fopen(name,mode)
+#define safe_fopen(name,mode) fopen(name,mode)
+#define safe_open2(name,flags) open(name,flags)
#define safe_open3(name,flags,mode) open(name,flags,mode)
#else
-#define safe_fopen(name,mode) fopen(name,mode)
-#define safe_open3(name,flags,mode) open(name,flags,mode)
-extern NCURSES_EXPORT(FILE *) _nc_safe_fopen (const char *, const char *);
-extern NCURSES_EXPORT(int) _nc_safe_open3 (const char *, int, mode_t);
+#define safe_fopen(name,mode) _nc_safe_fopen(name,mode)
+#define safe_open2(name,flags) _nc_safe_open2(name,flags,0)
+#define safe_open3(name,flags,mode) _nc_safe_open3(name,flags,mode)
+extern NCURSES_EXPORT(FILE *) _nc_safe_fopen (const char *, const char *);
+extern NCURSES_EXPORT(int) _nc_safe_open3 (const char *, int, mode_t);
#endif
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2000,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_echo.c,v 1.9 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_echo.c,v 1.10 2023/04/29 18:57:12 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0)
T((T_CALLED("echo(%p)"), (void *) SP_PARM));
if (0 == SP_PARM)
returnCode(ERR);
- SP_PARM->_echo = TRUE;
+ IsEcho(SP_PARM) = TRUE;
returnCode(OK);
}
T((T_CALLED("noecho(%p)"), (void *) SP_PARM));
if (0 == SP_PARM)
returnCode(ERR);
- SP_PARM->_echo = FALSE;
+ IsEcho(SP_PARM) = FALSE;
returnCode(OK);
}
/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#define NEED_KEY_EVENT
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.145 2022/12/24 22:38:38 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.146 2023/04/29 18:57:12 tom Exp $")
#include <fifo_defs.h>
} else
#endif
#if USE_KLIBC_KBD
- if (NC_ISATTY(sp->_ifd) && sp->_cbreak) {
- ch = _read_kbd(0, 1, !sp->_raw);
+ if (NC_ISATTY(sp->_ifd) && IsCbreak(sp)) {
+ ch = _read_kbd(0, 1, !IsRaw(sp));
n = (ch == -1) ? -1 : 1;
sp->_extended_key = (ch == 0);
} else
#if defined(USE_TERM_DRIVER)
int buf;
# if defined(EXP_WIN32_DRIVER)
- if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) {
+ if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && IsCbreak(sp)) {
_nc_set_read_thread(TRUE);
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
_nc_set_read_thread(FALSE);
} else
# elif defined(_NC_WINDOWS)
- if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak)
+ if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && IsCbreak(sp))
n = _nc_mingw_console_read(sp,
_nc_get_handle(sp->_ifd),
&buf);
*/
if (head == -1 &&
!sp->_notty &&
- !sp->_raw &&
- !sp->_cbreak &&
+ !IsRaw(sp) &&
+ !IsCbreak(sp) &&
!sp->_called_wgetch) {
char buf[MAXCOLUMNS], *bufp;
recur_wrefresh(win);
- if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) {
+ if (win->_notimeout || (win->_delay >= 0) || (IsCbreak(sp) > 1)) {
if (head == -1) { /* fifo is empty */
int delay;
TR(TRACE_IEVENT, ("timed delay in wgetch()"));
- if (sp->_cbreak > 1)
- delay = (sp->_cbreak - 1) * 100;
+ if (IsCbreak(sp) > 1)
+ delay = (IsCbreak(sp) - 1) * 100;
else
delay = win->_delay;
* However, we provide the same visual result as Solaris, moving the
* cursor to the left.
*/
- if (sp->_echo && !IS_PAD(win)) {
+ if (IsEcho(sp) && !IS_PAD(win)) {
chtype backup = (chtype) ((ch == KEY_BACKSPACE) ? '\b' : ch);
if (backup < KEY_MIN)
wechochar(win, backup);
/*
* Simulate ICRNL mode
*/
- if ((ch == '\r') && sp->_nl)
+ if ((ch == '\r') && IsNl(sp))
ch = '\n';
/* Strip 8th-bit if so desired. We do this only for characters that
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2011,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#define NEED_KEY_EVENT
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getstr.c,v 1.38 2021/10/23 19:02:39 tom Exp $")
+MODULE_ID("$Id: lib_getstr.c,v 1.39 2023/04/29 19:00:17 tom Exp $")
/*
* This wipes out the last character, no matter whether it was a tab, control
{
SCREEN *sp = _nc_screen_of(win);
TTY buf;
- bool oldnl, oldecho, oldraw, oldcbreak;
+ TTY_FLAGS save_flags;
char erasec;
char killc;
char *oldstr;
NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx &buf);
- oldnl = sp->_nl;
- oldecho = sp->_echo;
- oldraw = sp->_raw;
- oldcbreak = sp->_cbreak;
+ save_flags = sp->_tty_flags;
NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
- NCURSES_SP_NAME(raw) (NCURSES_SP_ARG);
+ if (!save_flags._raw)
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
erasec = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG);
killc = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG);
|| ch == '\r'
|| ch == KEY_DOWN
|| ch == KEY_ENTER) {
- if (oldecho == TRUE
+ if (save_flags._echo == TRUE
&& win->_cury == win->_maxy
&& win->_scroll)
wechochar(win, (chtype) '\n');
#endif
if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) {
if (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
}
} else if (ch == killc) {
while (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
}
} else if (ch >= KEY_MIN
|| (str - oldstr >= maxlen)) {
NCURSES_SP_NAME(beep) (NCURSES_SP_ARG);
} else {
*str++ = (char) ch;
- if (oldecho == TRUE) {
+ if (save_flags._echo == TRUE) {
int oldy = win->_cury;
if (waddch(win, (chtype) ch) == ERR) {
/*
*/
win->_flags &= ~_WRAPPED;
waddch(win, (chtype) ' ');
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
continue;
} else if (IS_WRAPPED(win)) {
/*
/* Restore with a single I/O call, to fix minor asymmetry between
* raw/noraw, etc.
*/
- sp->_nl = oldnl;
- sp->_echo = oldecho;
- sp->_raw = oldraw;
- sp->_cbreak = oldcbreak;
-
+ sp->_tty_flags = save_flags;
NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
*str = '\0';
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2000,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_nl.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.14 2023/04/29 18:51:49 tom Exp $")
#ifdef __EMX__
#include <io.h>
T((T_CALLED("nl(%p)"), (void *) SP_PARM));
if (0 == SP_PARM)
returnCode(ERR);
- SP_PARM->_nl = TRUE;
+ IsNl(SP_PARM) = TRUE;
#ifdef __EMX__
_nc_flush();
_fsetmode(NC_OUTPUT(SP_PARM), "t");
T((T_CALLED("nonl(%p)"), (void *) SP_PARM));
if (0 == SP_PARM)
returnCode(ERR);
- SP_PARM->_nl = FALSE;
+ IsNl(SP_PARM) = FALSE;
#ifdef __EMX__
_nc_flush();
_fsetmode(NC_OUTPUT(SP_PARM), "b");
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_restart.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_restart.c,v 1.18 2023/04/29 19:01:25 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx
if (TINFO_SETUP_TERM(&new_term, termp, filenum, errret, FALSE) != OK) {
result = ERR;
} else if (SP_PARM != 0) {
- int saveecho = SP_PARM->_echo;
- int savecbreak = SP_PARM->_cbreak;
- int saveraw = SP_PARM->_raw;
- int savenl = SP_PARM->_nl;
+ TTY_FLAGS save_flags = SP_PARM->_tty_flags;
#ifdef USE_TERM_DRIVER
SP_PARM->_term = new_term;
#endif
- if (saveecho) {
+ if (save_flags._echo) {
NCURSES_SP_NAME(echo) (NCURSES_SP_ARG);
} else {
NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
}
- if (savecbreak) {
+ if (save_flags._cbreak) {
NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
- } else if (saveraw) {
+ } else if (save_flags._raw) {
NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(raw) (NCURSES_SP_ARG);
} else {
NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
}
- if (savenl) {
+ if (save_flags._nl) {
NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
} else {
NCURSES_SP_NAME(nonl) (NCURSES_SP_ARG);
/****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 1998-2017,2018 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_screen.c,v 1.104 2021/10/23 17:12:16 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.105 2023/04/28 20:58:54 tom Exp $")
#define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */
typedef struct {
const char name[17];
PARAM_TYPE type;
- size_t size;
size_t offset;
} SCR_PARAMS;
};
#undef DATA
-#define sizeof2(type,name) sizeof(((type *)0)->name)
-#define DATA(name, type) { { #name }, type, sizeof2(WINDOW, name), offsetof(WINDOW, name) }
+#define DATA(name, type) { { #name }, type, offsetof(WINDOW, name) }
static const SCR_PARAMS scr_params[] =
{
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.663 2023/04/22 15:11:52 tom Exp $
+ * $Id: curses.priv.h,v 1.664 2023/04/29 19:10:30 tom Exp $
*
* curses.priv.h
*
ewSuspend
} ENDWIN;
+typedef struct {
+ int _nl; /* True if NL -> CR/NL is on */
+ int _raw; /* True if in raw mode */
+ int _cbreak; /* 1 if in cbreak mode */
+ /* > 1 if in halfdelay mode */
+ int _echo; /* True if echo on */
+} TTY_FLAGS;
+
+#define IsNl(sp) (sp)->_tty_flags._nl
+#define IsRaw(sp) (sp)->_tty_flags._raw
+#define IsCbreak(sp) (sp)->_tty_flags._cbreak
+#define IsEcho(sp) (sp)->_tty_flags._echo
+
/*
* The SCREEN structure.
*/
int _cursrow; /* physical cursor row */
int _curscol; /* physical cursor column */
bool _notty; /* true if we cannot switch non-tty */
- int _nl; /* True if NL -> CR/NL is on */
- int _raw; /* True if in raw mode */
- int _cbreak; /* 1 if in cbreak mode */
- /* > 1 if in halfdelay mode */
- int _echo; /* True if echo on */
+ TTY_FLAGS _tty_flags;
int _use_meta; /* use the meta key? */
struct _SLK *_slk; /* ptr to soft key struct / NULL */
int slk_format; /* selected format for this screen */
#endif
#define SP_PRE_INIT(sp) \
- sp->_cursrow = -1; \
- sp->_curscol = -1; \
- sp->_nl = TRUE; \
- sp->_raw = FALSE; \
- sp->_cbreak = 0; \
- sp->_echo = TRUE; \
- sp->_fifohead = -1; \
- sp->_endwin = ewSuspend; \
- sp->_cursor = -1; \
+ sp->_cursrow = -1; \
+ sp->_curscol = -1; \
+ IsNl(sp) = TRUE; \
+ IsRaw(sp) = FALSE; \
+ IsCbreak(sp) = 0; \
+ IsEcho(sp) = TRUE; \
+ sp->_fifohead = -1; \
+ sp->_endwin = ewSuspend; \
+ sp->_cursor = -1; \
SP_INIT_WINDOWLIST(sp); \
- sp->_outch = NCURSES_OUTC_FUNC; \
- sp->jump = 0 \
+ sp->_outch = NCURSES_OUTC_FUNC; \
+ sp->jump = 0 \
/* usually in <limits.h> */
#ifndef UCHAR_MAX
/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,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 <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_expand.c,v 1.34 2021/09/04 10:29:15 tom Exp $")
+MODULE_ID("$Id: comp_expand.c,v 1.35 2023/04/28 20:59:06 tom Exp $")
#if 0
#define DEBUG_THIS(p) DEBUG(9, p)
if (dst != 0
&& *dst == R_BRACE
&& value < 127
- && value != '\\' /* FIXME */
&& isprint((int) value)) {
ch = (int) value;
buffer[bufp++] = S_QUOTE;
/****************************************************************************
-,* Copyright 2020-2021,2022 Thomas E. Dickey *
+,* Copyright 2020-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 <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_scan.c,v 1.119 2022/08/07 00:20:26 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.120 2023/04/29 19:54:37 tom Exp $")
/*
* Maximum length of string capability we'll accept before raising an error.
/* push a character back onto the input stream */
{
if (bufptr == bufstart)
- _nc_syserr_abort("Can't backspace off beginning of line");
+ _nc_syserr_abort("cannot backspace off beginning of line");
*--bufptr = (char) c;
_nc_curr_col--;
}
/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2014,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_options.c,v 1.82 2021/02/14 00:17:35 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.83 2023/04/29 18:56:12 tom Exp $")
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
returnCode(ERR);
NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
- SP_PARM->_cbreak = t + 1;
+ IsCbreak(SP_PARM) = t + 1;
returnCode(OK);
}
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,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 <curses.priv.h>
-MODULE_ID("$Id: lib_raw.c,v 1.26 2020/11/21 22:07:48 tom Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.27 2023/04/29 18:56:30 tom Exp $")
#if HAVE_SYS_TERMIO_H
#include <sys/termio.h> /* needed for ISC */
KbdSetStatus(&kbdinfo, 0);
#endif
if (SP_PARM) {
- SP_PARM->_raw = TRUE;
- SP_PARM->_cbreak = 1;
+ IsRaw(SP_PARM) = TRUE;
+ IsCbreak(SP_PARM) = 1;
}
termp->Nttyb = buf;
}
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
if (SP_PARM) {
- SP_PARM->_cbreak = 1;
+ IsCbreak(SP_PARM) = 1;
}
termp->Nttyb = buf;
}
KbdSetStatus(&kbdinfo, 0);
#endif
if (SP_PARM) {
- SP_PARM->_raw = FALSE;
- SP_PARM->_cbreak = 0;
+ IsRaw(SP_PARM) = FALSE;
+ IsCbreak(SP_PARM) = 0;
}
termp->Nttyb = buf;
}
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
if (SP_PARM) {
- SP_PARM->_cbreak = 0;
+ IsCbreak(SP_PARM) = 0;
}
termp->Nttyb = buf;
}
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,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 <sys/types.h>
#include <tic.h>
-MODULE_ID("$Id: read_termcap.c,v 1.102 2021/09/04 10:29:15 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.103 2023/04/28 20:59:14 tom Exp $")
#if !PURE_TERMINFO
if (fd >= 0) {
(void) lseek(fd, (off_t) 0, SEEK_SET);
} else if ((_nc_access(db_array[current], R_OK) < 0)
- || (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
+ || (fd = safe_open2(db_array[current], O_RDONLY)) < 0) {
/* No error on unfound file. */
if (errno == ENOENT)
continue;
#include <tic.h>
+MODULE_ID("$Id: write_entry.c,v 1.126 2023/04/29 20:30:57 tom Exp $")
+
#if 1
#define TRACE_OUT(p) DEBUG(2, p)
#define TRACE_NUM(n) if (VALID_NUMERIC(Numbers[n])) { \
#define TRACE_NUM(n) /* nothing */
#endif
-MODULE_ID("$Id: write_entry.c,v 1.122 2023/04/17 08:08:08 tom Exp $")
+/*
+ * FIXME: special case to work around Cygwin bug in link(), which updates
+ * the target file's timestamp.
+ */
+#if HAVE_LINK && !USE_SYMLINKS && !MIXEDCASE_FILENAMES && defined(__CYGWIN__)
+#define LINK_TOUCHES 1
+#else
+#define LINK_TOUCHES 0
+#endif
static int total_written;
static int total_parts;
if (fp == 0) {
perror(filename);
- _nc_syserr_abort("can't open %s/%s", _nc_tic_dir(0), filename);
+ _nc_syserr_abort("cannot open %s/%s", _nc_tic_dir(0), filename);
}
actual = fwrite(buffer, sizeof(char), (size_t) offset, fp);
if (strcmp(filename, linkname) == 0) {
_nc_warning("self-synonym ignored");
- } else if (stat(linkname, &statbuf) >= 0 &&
- statbuf.st_mtime > start_time) {
+ }
+#if !LINK_TOUCHES
+ else if (stat(linkname, &statbuf) >= 0 &&
+ statbuf.st_mtime < start_time) {
_nc_warning("alias %s multiply defined.", ptr);
- } else if (_nc_access(linkname, W_OK) == 0)
+ }
+#endif
+ else if (_nc_access(linkname, W_OK) == 0)
#if HAVE_LINK
{
int code;
write_file(linkname, tp);
else {
#if MIXEDCASE_FILENAMES
- _nc_syserr_abort("can't link %s to %s", filename, linkname);
+ _nc_syserr_abort("cannot link %s to %s", filename, linkname);
#else
- _nc_warning("can't link %s to %s (errno=%d)", filename,
+ _nc_warning("cannot link %s to %s (errno=%d)", filename,
linkname, errno);
#endif
}
unsigned last_str = STRWRITE;
#if NCURSES_EXT_NUMBERS
bool need_ints = FALSE;
- size_t (*convert_numbers) (unsigned char *, NCURSES_INT2 *, size_t) = convert_32bit;
+ size_t (*convert_numbers) (unsigned char *, NCURSES_INT2 *, size_t);
#else
#define convert_numbers convert_shorts
#endif
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 1998-2014,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_vidattr.c,v 1.78 2020/05/27 23:56:32 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.79 2023/04/28 20:59:26 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
TurnOff(A_ITALIC, exit_italics_mode);
}
#endif
+ (void) turn_off;
}
PreviousAttr &= ALL_BUT_COLOR;
}
} else if (turn_off & A_ITALIC) {
TurnOff(A_ITALIC, exit_italics_mode);
}
+ (void) turn_off;
}
#endif
SetColorsIf((pair != 0) || fix_pair0, PreviousAttr);
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 2002-2009,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_get_wstr.c,v 1.20 2021/10/23 19:02:59 tom Exp $")
+MODULE_ID("$Id: lib_get_wstr.c,v 1.21 2023/04/29 19:02:03 tom Exp $")
static int
wadd_wint(WINDOW *win, wint_t *src)
{
SCREEN *sp = _nc_screen_of(win);
TTY buf;
- bool oldnl, oldecho, oldraw, oldcbreak;
+ TTY_FLAGS save_flags;
wchar_t erasec = 0;
wchar_t killc = 0;
wint_t *oldstr = str;
_nc_get_tty_mode(&buf);
- oldnl = sp->_nl;
- oldecho = sp->_echo;
- oldraw = sp->_raw;
- oldcbreak = sp->_cbreak;
+ save_flags = sp->_tty_flags;
NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
- NCURSES_SP_NAME(raw) (NCURSES_SP_ARG);
+ if (!save_flags._raw)
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(erasewchar) (NCURSES_SP_ARGx &erasec);
NCURSES_SP_NAME(killwchar) (NCURSES_SP_ARGx &killc);
* *getn_wstr() with \n should work either way.
*/
if (ch == KEY_DOWN || ch == KEY_ENTER) {
- if (oldecho == TRUE
+ if (save_flags._echo == TRUE
&& win->_cury == win->_maxy
&& win->_scroll)
wechochar(win, (chtype) '\n');
}
if (ch == KEY_LEFT || ch == KEY_BACKSPACE) {
if (tmpstr > oldstr) {
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
}
} else if (ch == KEY_EOL) {
while (tmpstr > oldstr) {
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
}
} else {
beep();
} else {
*tmpstr++ = ch;
*tmpstr = 0;
- if (oldecho == TRUE) {
+ if (save_flags._echo == TRUE) {
int oldy = win->_cury;
if (wadd_wint(win, tmpstr - 1) == ERR) {
*/
win->_flags &= ~_WRAPPED;
waddch(win, (chtype) ' ');
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
continue;
} else if (IS_WRAPPED(win)) {
/*
/* Restore with a single I/O call, to fix minor asymmetry between
* raw/noraw, etc.
*/
- sp->_nl = oldnl;
- sp->_echo = oldecho;
- sp->_raw = oldraw;
- sp->_cbreak = oldcbreak;
-
+ sp->_tty_flags = save_flags;
(void) _nc_set_tty_mode(&buf);
*tmpstr = 0;
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 2002-2014,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_vid_attr.c,v 1.30 2020/05/27 23:54:31 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.31 2023/04/28 20:59:34 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
TurnOff(A_ITALIC, exit_italics_mode);
}
#endif
+ (void) turn_off;
}
previous_attr &= ALL_BUT_COLOR;
previous_pair = 0;
} else if (turn_off & A_ITALIC) {
TurnOff(A_ITALIC, exit_italics_mode);
}
+ (void) turn_off;
}
#endif
SetColorsIf((color_pair != 0) || fix_pair0, previous_attr, previous_pair);
-ncurses6 (6.4+20230424) unstable; urgency=low
+ncurses6 (6.4+20230429) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 24 Apr 2023 03:48:00 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 Apr 2023 15:23:29 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230424) unstable; urgency=low
+ncurses6 (6.4+20230429) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 24 Apr 2023 03:48:00 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 Apr 2023 15:23:29 -0400
ncurses6 (5.9+20131005) unstable; urgency=low
-ncurses6 (6.4+20230424) unstable; urgency=low
+ncurses6 (6.4+20230429) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 24 Apr 2023 03:48:00 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 Apr 2023 15:23:29 -0400
ncurses6 (5.9+20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.580 2023/04/24 07:48:00 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.581 2023/04/28 19:23:29 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 "0424"\r
+!define VERSION_MMDD "0429"\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: 20230424
+Release: 20230429
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.4
-Release: 20230424
+Release: 20230429
License: X11
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.4
-Release: 20230424
+Release: 20230429
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
/*
* Author: Thomas E. Dickey
*
- * $Id: test_tparm.c,v 1.36 2023/04/23 23:20:43 tom Exp $
+ * $Id: test_tparm.c,v 1.37 2023/04/28 23:12:00 tom Exp $
*
* Exercise tparm/tiparm, either for all possible capabilities with fixed
* parameters, or one capability with specific combinations of parameters.
}
} else
#endif
- result = tiparm(NS_9(format));
+ result = tparm(NS_9(format));
total_tests++;
if (result != NULL) {
tputs(result, 1, output_func);