The following patch fixes a crash while trying to set a glyph to an
xbm in 21.5.8 (works in 21.4). If you do not have XBMLANGPATH
environment variable set, the egetenv returns NULL and the
C_STRING_TO_EXTERNAL call fails. Note that USE_XBMLANGPATH is always
defined just above the `x_locate_pixmap_file' function.
Is it ok to check if an Ibyte* is not 0? i.e. the if(path)?
Cheers,
Sean
Index: glyphs-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.69
diff -u -u -r1.69 glyphs-x.c
--- glyphs-x.c 2002/07/10 03:54:45 1.69
+++ glyphs-x.c 2002/07/30 02:23:59
@@ -588,20 +588,23 @@
#ifdef USE_XBMLANGPATH
{
Ibyte *path = egetenv ("XBMLANGPATH");
- Extbyte *pathext;
- SubstitutionRec subs[1];
- subs[0].match = 'B';
- LISP_STRING_TO_EXTERNAL (name, subs[0].substitution, Qfile_name);
- C_STRING_TO_EXTERNAL (path, pathext, Qfile_name);
- /* #### Motif uses a big hairy default if $XBMLANGPATH isn't set.
- We don't. If you want it used, set it. */
- if (pathext &&
- (pathext = XtResolvePathname (display, "bitmaps", 0, 0, pathext,
- subs, XtNumber (subs), 0)))
+ if(path)
{
- name = build_ext_string (pathext, Qfile_name);
- XtFree (pathext);
- return (name);
+ Extbyte *pathext;
+ SubstitutionRec subs[1];
+ subs[0].match = 'B';
+ LISP_STRING_TO_EXTERNAL (name, subs[0].substitution, Qfile_name);
+ C_STRING_TO_EXTERNAL (path, pathext, Qfile_name);
+ /* #### Motif uses a big hairy default if $XBMLANGPATH isn't set.
+ We don't. If you want it used, set it. */
+ if (pathext &&
+ (pathext = XtResolvePathname (display, "bitmaps", 0, 0, pathext,
+ subs, XtNumber (subs), 0)))
+ {
+ name = build_ext_string (pathext, Qfile_name);
+ XtFree (pathext);
+ return (name);
+ }
}
}
#endif
Show replies by date