Skip to content

Commit

Permalink
Fix a bug in the previous commit, with background colours
Browse files Browse the repository at this point in the history
  • Loading branch information
ec429 committed Mar 1, 2012
1 parent 8a360e3 commit d15db2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ttyesc.c
Expand Up @@ -29,7 +29,7 @@ int setcol(int fore, int back, bool hi, bool ul)
if(!f) f=tparm(set_foreground, fore);
if(f) putp(f);
const char *b=tparm(set_a_background, back);
if(!f) f=tparm(set_background, back);
if(!b) b=tparm(set_background, back);
if(b) putp(b);
fflush(stdout);
return(0);
Expand All @@ -56,7 +56,7 @@ int s_setcol(int fore, int back, bool hi, bool ul, char **rv, int *l, int *i)
if(!f) f=tparm(set_foreground, fore);
if(f) append_str(rv, l, i, f);
const char *b=tparm(set_a_background, back);
if(!f) f=tparm(set_background, back);
if(!b) b=tparm(set_background, back);
if(b) append_str(rv, l, i, b);
return(0);
}
Expand Down

0 comments on commit d15db2d

Please sign in to comment.