aboutsummaryrefslogtreecommitdiff
path: root/ncurses/tty/lib_vidattr.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
commitf0179cb6083cc92e5947ae56e6a0a5c5328aead0 (patch)
treebcee0ba9c2149b71f0bfc036df1e61e3105bf980 /ncurses/tty/lib_vidattr.c
parentcea297eb34d2361e79529034397465068ae34ecd (diff)
downloadsrc-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.tar.gz
src-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.zip
Vendor import ncurses 6.1-20200118vendor/ncurses/6.1-20200118
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=357645 svn path=/vendor/ncurses/6.1-20200118/; revision=357646; tag=vendor/ncurses/6.1-20200118
Diffstat (limited to 'ncurses/tty/lib_vidattr.c')
-rw-r--r--ncurses/tty/lib_vidattr.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c
index 0846d8485f42..49e754782597 100644
--- a/ncurses/tty/lib_vidattr.c
+++ b/ncurses/tty/lib_vidattr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -69,17 +69,24 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_vidattr.c,v 1.67 2013/08/31 20:08:59 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.74 2019/04/13 22:40:54 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc)
#define TurnOn(mask, mode) \
- if ((turn_on & mask) && mode) { doPut(mode); }
+ if ((turn_on & mask) && mode) { \
+ TPUTS_TRACE(#mode); \
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc); \
+ }
#define TurnOff(mask, mode) \
- if ((turn_off & mask) && mode) { doPut(mode); turn_off &= ~mask; }
+ if ((turn_off & mask) && mode) { \
+ TPUTS_TRACE(#mode); \
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc); \
+ turn_off &= ~mask; \
+ }
/* if there is no current screen, assume we *can* do color */
#define SetColorsIf(why, old_attr) \
@@ -117,7 +124,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode)));
- if (!IsTermInfo(SP_PARM))
+ if (!IsValidTIScreen(SP_PARM))
returnCode(ERR);
/* this allows us to go on whether or not newterm() has been called */
@@ -213,7 +220,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
}
turn_off = (~newmode & PreviousAttr) & ALL_BUT_COLOR;
- turn_on = (newmode & ~PreviousAttr) & ALL_BUT_COLOR;
+ turn_on = (newmode & ~(PreviousAttr & TPARM_ATTR)) & ALL_BUT_COLOR;
SetColorsIf(((pair == 0) && !fix_pair0), PreviousAttr);
@@ -308,7 +315,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
#if USE_ITALIC
TurnOn(A_ITALIC, enter_italics_mode);
#endif
-#if USE_WIDEC_SUPPORT
+#if USE_WIDEC_SUPPORT && defined(enter_horizontal_hl_mode)
TurnOn(A_HORIZONTAL, enter_horizontal_hl_mode);
TurnOn(A_LEFT, enter_left_hl_mode);
TurnOn(A_LOW, enter_low_hl_mode);
@@ -368,7 +375,7 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
if (HasTerminal(SP_PARM)) {
#ifdef USE_TERM_DRIVER
- attrs = CallDriver(SP_PARM, conattr);
+ attrs = CallDriver(SP_PARM, td_conattr);
#else /* ! USE_TERM_DRIVER */
if (enter_alt_charset_mode)