[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SCREEN incompatibility between ncurses and ncursesw
From: |
Miroslav Lichvar |
Subject: |
SCREEN incompatibility between ncurses and ncursesw |
Date: |
Mon, 29 May 2017 18:19:45 +0200 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
Hi,
after upgrading to a recent ncurses version, applications using narrow
libncurses and wide libtinfo started crashing in _nc_init_acs_sp()
when accessing sp->_acs_map.
It seems the problem is caused by the new fields in SCREEN that are
wrapped in USE_NEW_PAIR, which breaks compatibility between the two
definitions used narrow ncurses and wide tinfo.
I tried moving the fields to the end of the structure close to the
WIDEC fields and it seems it fixed the crash. I'm not sure if this is
the best way to fix it.
--- a/ncurses/curses.priv.h
+++ b/ncurses/curses.priv.h
@@ -1137,11 +1137,6 @@ struct screen {
int _pair_count; /* same as COLOR_PAIRS */
int _pair_limit; /* actual limit of color-pairs */
#if NCURSES_EXT_FUNCS
-#if USE_NEW_PAIR
- void *_ordered_pairs; /* index used by alloc_pair() */
- int _pairs_used; /* actual number of color-pairs used */
- int _recent_pair; /* number for most recent free-pair */
-#endif
bool _assumed_color; /* use assumed colors */
bool _default_color; /* use default colors */
bool _has_sgr_39_49; /* has ECMA default color support */
@@ -1295,6 +1290,11 @@ struct screen {
/*
* ncurses/ncursesw are the same up to this point.
*/
+#if NCURSES_EXT_FUNCS && USE_NEW_PAIR
+ void *_ordered_pairs; /* index used by alloc_pair() */
+ int _pairs_used; /* actual number of color-pairs used */
+ int _recent_pair; /* number for most recent free-pair */
+#endif
#if USE_WIDEC_SUPPORT
/* recent versions of 'screen' have partially-working support for
* UTF-8, but do not permit ACS at the same time (see tty_update.c).
--
Miroslav Lichvar
- SCREEN incompatibility between ncurses and ncursesw,
Miroslav Lichvar <=