]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_vidattr.c
ncurses 6.0 - patch 20170701
[ncurses.git] / ncurses / tty / lib_vidattr.c
index 2d9c97b7c226f72fc906e688b79aef7158aba0d1..18420e1b4372c42f6028119d8c33b0a99dcff90a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2014,2017 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,7 +69,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_vidattr.c,v 1.68 2014/03/08 20:32:59 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.72 2017/06/24 12:13:42 tom Exp $")
 
 #define doPut(mode) \
        TPUTS_TRACE(#mode); \
@@ -117,7 +117,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 +213,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);