Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: dank@moc.jpl.nasa.gov (Dan Kegel) Newsgroups: comp.sys.sun Subject: crttool doesn't set WINDOW_GFX; patch Keywords: Source Message-ID: <1464@brchh104.bnr.ca> Date: 25 Jan 91 16:45:05 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 50 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 10, Issue 26, message 17 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu 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@moc.jpl.nasa.gov)