]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_vidattr.c
ncurses 6.1 - patch 20180623
[ncurses.git] / ncurses / tty / lib_vidattr.c
index 184d9b976d5492f65789b2af606d8a3e5ad41203..acad0fba2a6da68eb8c1232476e0de6a3f50454f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 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            *
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_vidattr.c,v 1.71 2014/09/04 22:01:27 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.73 2018/03/03 22:08:12 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 */