Changeset 3377:ec04b0df9dec for color.c

Show
Ignore:
Timestamp:
2003-04-08 14:41:39 (6 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Make sure has_colors() is only invoked when OPTNOCURSES is unset.
This fixes a segmentation fault on RH 8.0 which was observed by Matt
Larson <mlarson@…>.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • color.c

    r3173 r3377  
    393393  if( 
    394394#ifdef HAVE_COLOR 
    395      (parse_uncolor && !option(OPTNOCURSES) && !has_colors()) 
     395     /* we're running without curses */ 
     396     option (OPTNOCURSES)  
     397     || /* we're parsing an uncolor command, and have no colors */ 
     398     (parse_uncolor && !has_colors()) 
     399     /* we're parsing an unmono command, and have colors */ 
    396400     || (!parse_uncolor && has_colors()) 
    397401#else 
     402     /* We don't even have colors compiled in */ 
    398403     parse_uncolor 
    399404#endif 
    400405     ) 
    401406  { 
     407    /* just eat the command, but don't do anything real about it */ 
    402408    do 
    403409      mutt_extract_token (buf, s, 0); 
     
    708714#ifdef HAVE_COLOR 
    709715# ifdef HAVE_USE_DEFAULT_COLORS 
    710   if (has_colors() 
     716  if (!option (OPTNOCURSES) && has_colors() 
    711717    /* delay use_default_colors() until needed, since it initializes things */ 
    712718    && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT) 
     
    757763#ifdef HAVE_COLOR 
    758764# ifdef HAVE_BKGDSET 
    759   if (object == MT_COLOR_NORMAL && has_colors()) 
     765  if (object == MT_COLOR_NORMAL && !option (OPTNOCURSES) && has_colors()) 
    760766    BKGDSET (MT_COLOR_NORMAL); 
    761767# endif