[comp.windows.x] color fix to clients/bitmap/bitmap.c

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (09/23/87)

The following diffs should stop bitmap from dumping core when specifying
colors on a color screen:

*** /tmp/,RCSt1015165	Wed Sep 23 10:04:37 1987
--- bitmap.c	Wed Sep 23 09:31:07 1987
***************
*** 1,5 ****
  #ifndef lint
! static char *rcsid_bitmap_c = "$Header: bitmap.c,v 1.12 87/09/11 23:19:52 sun Exp $";
  #endif
  
  #include <errno.h>
--- 1,5 ----
  #ifndef lint
! static char *rcsid_bitmap_c = "$Header: bitmap.c,v 1.14 87/09/23 09:30:32 rws Exp $";
  #endif
  
  #include <errno.h>
***************
*** 380,400 ****
        XAllocColorCells(d, cmap, FALSE, masks, high_color ? 2 : 1,
  	 &background, 1)) {
        bdef.pixel = background;
!       XStoreColor(&bdef);
        invertplane = masks[0];
        if (high_color) {
  	highlightplane = masks[1];
  	hdef.pixel = background | highlightplane;
! 	XStoreColor(&hdef);
  	hdef.pixel |= invertplane;
! 	XStoreColor(&hdef);
        } else
  	highlightplane = invertplane;
        fdef.pixel = foreground = background | invertplane;
!       XStoreColor(&fdef);
      }
      if (brdr_color && XParseColor(d, cmap, brdr_color, &bdef) &&
! 	XAllocColor(&bdef))
        border = bdef.pixel;
    }
  
--- 380,400 ----
        XAllocColorCells(d, cmap, FALSE, masks, high_color ? 2 : 1,
  	 &background, 1)) {
        bdef.pixel = background;
!       XStoreColor(d, cmap, &bdef);
        invertplane = masks[0];
        if (high_color) {
  	highlightplane = masks[1];
  	hdef.pixel = background | highlightplane;
! 	XStoreColor(d, cmap, &hdef);
  	hdef.pixel |= invertplane;
! 	XStoreColor(d, cmap, &hdef);
        } else
  	highlightplane = invertplane;
        fdef.pixel = foreground = background | invertplane;
!       XStoreColor(d, cmap, &fdef);
      }
      if (brdr_color && XParseColor(d, cmap, brdr_color, &bdef) &&
! 	XAllocColor(d, cmap, &bdef))
        border = bdef.pixel;
    }