changeset 65072:462eb3df5c58

(turn_on_face): Check for TS_set_foreground and TS_set_background depending on standout_mode. Simplify.
author Juri Linkov <juri@jurta.org>
date Mon, 22 Aug 2005 20:47:49 +0000
parents 98f3b2a3270e
children 408e294257ab
files src/term.c
diffstat 1 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/term.c	Mon Aug 22 19:55:57 2005 +0000
+++ b/src/term.c	Mon Aug 22 20:47:49 2005 +0000
@@ -2011,24 +2011,20 @@
 
   if (TN_max_colors > 0)
     {
-      char *p;
-
-      if (fg >= 0 && TS_set_foreground)
+      char *ts, *p;
+
+      ts = standout_mode ? TS_set_background : TS_set_foreground;
+      if (fg >= 0 && ts)
 	{
-	  if (standout_mode)
-	    p = tparam (TS_set_background, NULL, 0, (int) fg);
-	  else
-	    p = tparam (TS_set_foreground, NULL, 0, (int) fg);
+	  p = tparam (ts, NULL, 0, (int) fg);
 	  OUTPUT (p);
 	  xfree (p);
 	}
 
-      if (bg >= 0 && TS_set_background)
+      ts = standout_mode ? TS_set_foreground : TS_set_background;
+      if (bg >= 0 && ts)
 	{
-	  if (standout_mode)
-	    p = tparam (TS_set_foreground, NULL, 0, (int) bg);
-	  else
-	    p = tparam (TS_set_background, NULL, 0, (int) bg);
+	  p = tparam (ts, NULL, 0, (int) bg);
 	  OUTPUT (p);
 	  xfree (p);
 	}