crttool doesn't set WINDOW_GFX; patch

Dan Kegel dank at moc.jpl.nasa.gov
Sat Jan 26 03:45:05 AEST 1991


crttool, a great vt200 emulator by Jonathan Olson that runs under Sunview,
doesn't seem to provide the WINDOW_GFX and WINDOW_ME environment variables
to its child process.  This caused one graphics-related program to choke,
so I patched the sources to set these variables.  Here are the context
diffs to version 1.1 of crttool.c dated 89/11/16:

[[Ed's Note: short enough to include inline. -bdg]]

---------------------------- cut here -------------------------
*** crttool.c.old	Fri Jan 25 08:38:30 1991
--- crttool.c	Fri Jan 25 08:38:15 1991
***************
*** 152,157 ****
--- 152,158 ----
    struct singlecolor fg, bg;
    struct screen rootscreen;
    Pixwin *pw;
+   char *window_device_name;

    crt.icon = icon_create(ICON_IMAGE, &crttool_pixrect, 0);
    crt.frame =
***************
*** 163,168 ****
--- 164,186 ----
  		  FRAME_BACKGROUND_COLOR, onecolor(&bg, COLOR_WHITE),
  		  FRAME_ARGC_PTR_ARGV, 	  &argc, argv,
  		  0);
+ 
+   /* Dan Kegel's mod to support environment variables set in shelltool.
+    * I don't know if this is the right way to do this.
+    */
+   window_device_name = (char *)window_get(crt.frame, WIN_DEVICE_NAME);
+   if (window_device_name) {
+     char *buf, *malloc();
+ 
+     buf=malloc(50);
+     sprintf(buf, "WINDOW_ME=%s", window_device_name);
+     putenv(buf);
+ 
+     buf=malloc(50);
+     sprintf(buf, "WINDOW_GFX=%s", window_device_name);
+     putenv(buf);
+   }
+   /* End of mod. */

    crt.framefd = (int)window_get(crt.frame, WIN_FD);
    win_screenget(crt.framefd, &rootscreen);
---------------------------- cut here -------------------------

Dan Kegel (dank at moc.jpl.nasa.gov)



More information about the Comp.sys.sun mailing list