X11/src ConnDis.c, 3.31, 3.32 ErrDes.c, 3.13, 3.14 GetWAttrs.c, 1.3, 1.4 Host.c, 1.5, 1.6 KeyBind.c, 1.9, 1.10 LiHosts.c, 1.6, 1.7 OpenDis.c, 3.25, 3.26 PutBEvent.c, 1.4, 1.5 StrKeysym.c, 3.9, 3.10 XKBBind.c, 3.20, 3.21 XKBCvt.c, 3.36, 3.37 XlibInt.c, 3.46, 3.47 cmsCmap.c, 3.4, 3.5 cmsColNm.c, 3.14, 3.15 imDefLkup.c, 3.12, 3.13 imInsClbk.c, 3.4, 3.5 imLcFlt.c, 1.1.1.4, 1.2 imRm.c, 3.13, 3.14 imThaiFlt.c, 3.23, 3.24 imTrans.c, 1.6, 1.7 lcEuc.c, 3.13, 3.14 lcFile.c, 3.34, 3.35 lcSjis.c, 3.10, 3.11 lcUTF8.c, 1.17, 1.18 omGeneric.c, 3.28, 3.29

Daniel Stone xlibs-commit@pdx.freedesktop.org
Fri Jan 28 10:48:10 PST 2005


Committed by: daniels

Update of /cvs/xlibs/X11/src
In directory gabe:/tmp/cvs-serv2397/src

Modified Files:
	ConnDis.c ErrDes.c GetWAttrs.c Host.c KeyBind.c LiHosts.c 
	OpenDis.c PutBEvent.c StrKeysym.c XKBBind.c XKBCvt.c XlibInt.c 
	cmsCmap.c cmsColNm.c imDefLkup.c imInsClbk.c imLcFlt.c imRm.c 
	imThaiFlt.c imTrans.c lcEuc.c lcFile.c lcSjis.c lcUTF8.c 
	omGeneric.c 
Log Message:
* include/X11/Xutil.h:
* include/X11/Xlib.h:
* include/X11/Xlibint.h:
* src/ConnDis.c (_X11TransConnectDisplay):
* src/ErrDes.c (XGetErrorDatabaseText):
* src/GetWAttrs.c (XGetWindowAttributes):
* src/Host.c:
* src/KeyBind.c (UCSConvertCase) (XConvertCase):
* src/LiHosts.c:
* src/OpenDis.c:
* src/PutBEvent.c (XPutBackEvent):
* src/StrKeysym.c (XStringToKeysym):
* src/XKBBind.c (XkbRefreshKeyboardMapping):
* src/XKBCvt.c:
* src/XlibInt.c:
* src/cmsCmap.c:
* src/cmsColNm.c:
* src/imDefLkup.c (_XimGetWindowEventmask):
* src/imInsClbk.c (_XimUnRegisterIMInstantiateCallback):
* src/imLcFlt.c (_XimLocalFilter):
* src/imLcIm.c (_XimLocalIMFree):
* src/imRm.c:
* src/imThaiFlt.c (tis2ucs):
* src/imTrans.c:
* src/lcEuc.c (euc_ctstowcs) (euc_ctstombs):
* src/lcFile.c:
* src/lcSjis.c:
* src/lcUTF8.c (create_tofontcs_conv):
* src/omGeneric.c (parse_fontdata):
* src/util/makekeys.c (main):
Resync with X.Org HEAD, including a security fix for the error DB name
and a minor stack smash in XKB code, thread-safe XGetWindowAttributes
and XPutBackEvent, case-conversion cleanups and updates, and large-scale
localisation/input cleanups and adherance to the specification.


Index: ConnDis.c
===================================================================
RCS file: /cvs/xlibs/X11/src/ConnDis.c,v
retrieving revision 3.31
retrieving revision 3.32
diff -u -d -r3.31 -r3.32
--- ConnDis.c	29 Jun 2004 15:42:33 -0000	3.31
+++ ConnDis.c	28 Jan 2005 18:48:07 -0000	3.32
@@ -343,13 +343,13 @@
 	if (olen > sizeof addrbuf) address = Xmalloc (olen);
     }
 
+    if (!address) goto bad;
+
     sprintf(address,"%s/%s:%d",
 	pprotocol ? pprotocol : "",
 	phostname ? phostname : "",
 	idisplay );
 
-    if (!address) goto bad;
-
     /*
      * Make the connection, also need to get the auth address info for
      * the connection.  Do retries in case server host has hit its

Index: ErrDes.c
===================================================================
RCS file: /cvs/xlibs/X11/src/ErrDes.c,v
retrieving revision 3.13
retrieving revision 3.14
diff -u -d -r3.13 -r3.14
--- ErrDes.c	1 Feb 2004 16:16:03 -0000	3.13
+++ ErrDes.c	28 Jan 2005 18:48:07 -0000	3.14
@@ -55,10 +55,6 @@
 #include "Xresource.h"
 #include <stdio.h>
 
-#ifdef X11_DATADIR
-#define ERRORDB X11_DATADIR "/XErrorDB"
-#endif
-
 #ifndef ERRORDB
 #define ERRORDB "/usr/lib/X11/XErrorDB"
 #endif
@@ -149,9 +145,17 @@
 	   mutex unlocked. */
 	XrmDatabase temp_db;
 	int do_destroy;
+	const char *db_name;
 
 	XrmInitialize();
-	temp_db = XrmGetFileDatabase(ERRORDB);
+#ifdef WIN32
+	dbname = getenv("XERRORDB");
+	if (!dbname)
+	    dbname = ERRORDB;
+#else
+	dbname = ERRORDB;
+#endif
+	temp_db = XrmGetFileDatabase(dbname);
 
 	_XLockMutex(_Xglobal_lock);
 	if (!db) {

Index: GetWAttrs.c
===================================================================
RCS file: /cvs/xlibs/X11/src/GetWAttrs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- GetWAttrs.c	13 Apr 2003 19:22:16 -0000	1.3
+++ GetWAttrs.c	28 Jan 2005 18:48:07 -0000	1.4
@@ -84,10 +84,10 @@
     return True;
 }
 
-Status XGetWindowAttributes(dpy, w, attr)
-     register Display *dpy;
-     Window w;
-     XWindowAttributes *attr;
+Status _XGetWindowAttributes(
+     register Display *dpy,
+     Window w,
+     XWindowAttributes *attr)
 {       
     xGetGeometryReply rep;
     register xResourceReq *req;
@@ -96,7 +96,6 @@
     _XAsyncHandler async;
     _XWAttrsState async_state;
  
-    LockDisplay(dpy);
     GetResReq(GetWindowAttributes, w, req);
 
     async_state.attr_seq = dpy->request;
@@ -113,14 +112,10 @@
 
     if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
 	DeqAsyncHandler(dpy, &async);
-	UnlockDisplay(dpy);
-	SyncHandle();
 	return (0);
 	}
     DeqAsyncHandler(dpy, &async);
     if (!async_state.attr) {
-	UnlockDisplay(dpy);
-	SyncHandle();
 	return (0);
     }
     attr->x = cvtINT16toInt (rep.x);
@@ -138,8 +133,22 @@
 	    break;
 	}
     }
+    return(1);
+}
+
+Status
+XGetWindowAttributes(
+    Display *dpy,
+    Window w,
+    XWindowAttributes *attr)
+{
+    Status ret;
+
+    LockDisplay(dpy);
+    ret = _XGetWindowAttributes(dpy, w, attr);
     UnlockDisplay(dpy);
     SyncHandle();
     return(1);
-}
 
+    return ret;
+}

Index: Host.c
===================================================================
RCS file: /cvs/xlibs/X11/src/Host.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Host.c	27 Jun 2004 22:31:31 -0000	1.5
+++ Host.c	28 Jan 2005 18:48:07 -0000	1.6
@@ -2,26 +2,36 @@
 /*
 
 Copyright 1986, 1998  The Open Group
+Copyright 2004 Sun Microsystems, Inc.
 
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
+All rights reserved.
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+X Window System is a trademark of The Open Group.
 
 */
 /* $XFree86: xc/lib/X11/Host.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */

Index: KeyBind.c
===================================================================
RCS file: /cvs/xlibs/X11/src/KeyBind.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- KeyBind.c	1 Feb 2004 16:16:03 -0000	1.9
+++ KeyBind.c	28 Jan 2005 18:48:07 -0000	1.10
@@ -456,9 +456,9 @@
 
     /* Basic Latin and Latin-1 Supplement, U+0000 to U+00FF */
     if (code <= 0x00ff) {
-        if (code >= 0x0041 && code <= 0x005a)
+        if (code >= 0x0041 && code <= 0x005a)		/* A-Z */
             *lower += 0x20;
-        else if (code >= 0x0061 && code <= 0x007a)
+        else if (code >= 0x0061 && code <= 0x007a)	/* a-z */
             *upper -= 0x20;
         else if ( (code >= 0x00c0 && code <= 0x00d6) ||
 	          (code >= 0x00d8 && code <= 0x00de) )
@@ -466,10 +466,11 @@
         else if ( (code >= 0x00e0 && code <= 0x00f6) ||
 	          (code >= 0x00f8 && code <= 0x00fe) )
             *upper -= 0x20;
-        else if (code == 0x00ff)
+        else if (code == 0x00ff)			/* y with diaeresis */
             *upper = 0x0178;
-        else if (code == 0x00b5)
+        else if (code == 0x00b5)			/* micro sign */
             *upper = 0x039c;
+	return;
     }
 
     /* Latin Extended-A, U+0100 to U+017F */
@@ -495,6 +496,7 @@
             *lower = 0x00ff; 
         else if (code == 0x017f)
             *upper = 0x0053; 
+	return;
     }
 
     /* Latin Extended-B, U+0180 to U+024F */
@@ -530,6 +532,7 @@
             *lower = 0x01bf;
         else if (code == 0x0220)
             *lower = 0x019e;
+	return;
     }
 
     /* IPA Extensions, U+0250 to U+02AF */
@@ -644,6 +647,12 @@
     KeySym *lower;
     KeySym *upper;
 {
+    /* Latin 1 keysym */
+    if (sym < 0x100) {
+        UCSConvertCase(sym, upper, lower);
+	return;
+    }
+	
     /* Unicode keysym */
     if ((sym & 0xff000000) == 0x01000000) {
         UCSConvertCase((sym & 0x00ffffff), lower, upper);
@@ -652,26 +661,11 @@
         return;
     }
 
+    /* Legacy keysym */
     *lower = sym;
     *upper = sym;
 
     switch(sym >> 8) {
-    case 0: /* Latin 1 */
-	if ((sym >= XK_A) && (sym <= XK_Z))
-	    *lower += (XK_a - XK_A);
-	else if ((sym >= XK_a) && (sym <= XK_z))
-	    *upper -= (XK_a - XK_A);
-	else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
-	    *lower += (XK_agrave - XK_Agrave);
-	else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
-	    *upper -= (XK_agrave - XK_Agrave);
-	else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
-	    *lower += (XK_oslash - XK_Ooblique);
-	else if ((sym >= XK_oslash) && (sym <= XK_thorn))
-	    *upper -= (XK_oslash - XK_Ooblique);
-        else if (sym == XK_ydiaeresis)
-            *upper = XK_Ydiaeresis; /* actually a Latin 9 character */
-	break;
     case 1: /* Latin 2 */
 	/* Assume the KeySym is a legal value (ignore discontinuities) */
 	if (sym == XK_Aogonek)
@@ -750,63 +744,6 @@
 		 sym != XK_Greek_finalsmallsigma)
 	    *upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
         break;
-    case 0x12: /* Latin 8 */
-        /* No neat pattern to the values */
-        switch (sym) {
-            case XK_Babovedot:
-                *lower = XK_babovedot; break;
-            case XK_babovedot:
-                *upper = XK_Babovedot; break;
-            case XK_Dabovedot:
-                *lower = XK_dabovedot; break;
-            case XK_Wgrave:
-                *lower = XK_wgrave; break;
-            case XK_Wacute:
-                *lower = XK_wacute; break;
-            case XK_dabovedot:
-                *upper = XK_Dabovedot; break;
-            case XK_Ygrave:
-                *lower = XK_ygrave; break;
-            case XK_Fabovedot:
-                *lower = XK_fabovedot; break;
-            case XK_fabovedot:
-                *upper = XK_Fabovedot; break;
-            case XK_Mabovedot:
-                *lower = XK_mabovedot; break;
-            case XK_mabovedot:
-                *upper = XK_Mabovedot; break;
-            case XK_Pabovedot:
-                *lower = XK_pabovedot; break;
-            case XK_wgrave:
-                *upper = XK_Wgrave; break;
-            case XK_pabovedot:
-                *upper = XK_Pabovedot; break;
-            case XK_wacute:
-                *upper = XK_Wacute; break;
-            case XK_Sabovedot:
-                *lower = XK_sabovedot; break;
-            case XK_ygrave:
-                *upper = XK_Ygrave; break;
-            case XK_Wdiaeresis:
-                *lower = XK_wdiaeresis; break;
-            case XK_wdiaeresis:
-                *upper = XK_Wdiaeresis; break;
-            case XK_sabovedot:
-                *upper = XK_Sabovedot; break;
-            case XK_Wcircumflex:
-                *lower = XK_wcircumflex; break;
-            case XK_Tabovedot:
-                *lower = XK_tabovedot; break;
-            case XK_Ycircumflex:
-                *lower = XK_ycircumflex; break;
-            case XK_wcircumflex:
-                *upper = XK_Wcircumflex; break;
-            case XK_tabovedot:
-                *upper = XK_Tabovedot; break;
-            case XK_ycircumflex:
-                *upper = XK_Ycircumflex; break;
-	    }
-        break;
     case 0x13: /* Latin 9 */
         if (sym == XK_OE)
             *lower = XK_oe;
@@ -815,45 +752,6 @@
         else if (sym == XK_Ydiaeresis)
             *lower = XK_ydiaeresis;
         break;
-    case 0x14: /* Armenian */
-	if (sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe) {
-	    *lower = sym | 1;
-	    *upper = sym & ~1;
-	}
-        break;
-    case 0x16: /* Caucasus, Inupiak, Guarani */
-        if (sym == XK_ocaron || sym == XK_Ocaron) {
-	    *upper = XK_Ocaron;
-	    *lower = XK_ocaron;
-        }
-        else if (sym >= XK_Ccedillaabovedot && sym <= XK_Obarred)
-	    *lower += (XK_ccedillaabovedot - XK_Ccedillaabovedot);
-        else if (sym >= XK_ccedillaabovedot && sym <= XK_obarred)
-	    *upper -= (XK_ccedillaabovedot - XK_Ccedillaabovedot);
-	else if (sym == XK_schwa || sym == XK_SCHWA) {
-	    *lower = XK_schwa;
-	    *upper = XK_SCHWA;
-	}
-	else if (sym == XK_lbelowdot || sym == XK_Lbelowdot) {
-	    *lower = XK_lbelowdot;
-	    *upper = XK_Lbelowdot;
-	}
-	else if (sym == XK_lstrokebelowdot || sym == XK_Lstrokebelowdot) {
-	    *lower = XK_lstrokebelowdot;
-	    *upper = XK_Lstrokebelowdot;
-	}
-	else if (sym == XK_gtilde || sym == XK_Gtilde) {
-	    *lower = XK_gtilde;
-	    *upper = XK_Gtilde;
-	}
-        break;
-    case 0x1e: /* Vietnamese */
-        if ((sym >= XK_Abelowdot && sym <= XK_uhornbelowdot) ||
-	    (sym >= XK_Ybelowdot && sym <= XK_uhorn)) {
-	    *lower = sym | 1;
-	    *upper = sym & ~1;
-        }
-        break;
     }
 }
 

Index: LiHosts.c
===================================================================
RCS file: /cvs/xlibs/X11/src/LiHosts.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- LiHosts.c	27 Jun 2004 22:31:31 -0000	1.6
+++ LiHosts.c	28 Jan 2005 18:48:07 -0000	1.7
@@ -2,26 +2,36 @@
 /*
 
 Copyright 1986, 1998  The Open Group
+Copyright 2004 Sun Microsystems, Inc.
 
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
+All rights reserved.
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+X Window System is a trademark of The Open Group.
 
 */
 

Index: OpenDis.c
===================================================================
RCS file: /cvs/xlibs/X11/src/OpenDis.c,v
retrieving revision 3.25
retrieving revision 3.26
diff -u -d -r3.25 -r3.26
--- OpenDis.c	29 Jun 2004 15:42:33 -0000	3.25
+++ OpenDis.c	28 Jan 2005 18:48:07 -0000	3.26
@@ -59,10 +59,6 @@
 } _XBigReqState;
 #endif /* !USE_XCB */
 
-#ifdef WIN32
-int *_Xdebug_p = &_Xdebug;
-#endif
-
 #ifdef XTHREADS
 #include "locking.h"
 int  (*_XInitDisplayLock_fn)(Display *dpy) = NULL;

Index: PutBEvent.c
===================================================================
RCS file: /cvs/xlibs/X11/src/PutBEvent.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- PutBEvent.c	14 Dec 2001 19:54:03 -0000	1.4
+++ PutBEvent.c	28 Jan 2005 18:48:07 -0000	1.5
@@ -33,16 +33,14 @@
 #include "Xlibint.h"
 
 int
-XPutBackEvent (dpy, event)
-	register Display *dpy;
-	register XEvent *event;
-	{
+_XPutBackEvent (
+	register Display *dpy,
+	register XEvent *event)
+{
 	register _XQEvent *qelt;
 
-	LockDisplay(dpy);
 	if (!dpy->qfree) {
     	    if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) {
-		UnlockDisplay(dpy);
 		return 0;
 	    }
 	    dpy->qfree->next = NULL;
@@ -56,6 +54,19 @@
 	if (dpy->tail == NULL)
 	    dpy->tail = qelt;
 	dpy->qlen++;
-	UnlockDisplay(dpy);
 	return 0;
-	}
+}
+
+
+int
+XPutBackEvent (
+    register Display * dpy,
+    register XEvent *event)
+       {
+       int ret;
+
+       LockDisplay(dpy);
+       ret = _XPutBackEvent(dpy, event);
+       UnlockDisplay(dpy);
+       return ret;
+       }

Index: StrKeysym.c
===================================================================
RCS file: /cvs/xlibs/X11/src/StrKeysym.c,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -d -r3.9 -r3.10
--- StrKeysym.c	1 Feb 2004 16:16:03 -0000	3.9
+++ StrKeysym.c	28 Jan 2005 18:48:07 -0000	3.10
@@ -35,10 +35,6 @@
 #include "ks_tables.h"
 #include "Key.h"
 
-#ifdef X11_DATADIR
-#define KEYSYMDB X11_DATADIR "/XKeysymDB"
-#endif
-
 #ifndef KEYSYMDB
 #define KEYSYMDB "/usr/lib/X11/XKeysymDB"
 #endif
@@ -68,8 +64,8 @@
     return keysymdb;
 }
 
-KeySym XStringToKeysym(s)
-    _Xconst char *s;
+KeySym
+XStringToKeysym(_Xconst char *s)
 {
     register int i, n;
     int h;
@@ -92,9 +88,10 @@
     {
 	entry = &_XkeyTable[idx];
 	if ((entry[0] == sig1) && (entry[1] == sig2) &&
-	    !strcmp(s, (char *)entry + 4))
+	    !strcmp(s, (char *)entry + 6))
 	{
-	    val = (entry[2] << 8) | entry[3];
+	    val = (entry[2] << 24) | (entry[3] << 16) |
+                  (entry[4] << 8) | entry[5];
 	    if (!val)
 		val = XK_VoidSymbol;
 	    return val;
@@ -143,7 +140,9 @@
 	    else return NoSymbol;
 
 	}
-	if (val >= 0x01000000)
+	if (val < 0x100)
+            return val;
+	if (val > 0x10ffff || val < 0x100)
 	    return NoSymbol;
         return val | 0x01000000;
     }

Index: XKBBind.c
===================================================================
RCS file: /cvs/xlibs/X11/src/XKBBind.c,v
retrieving revision 3.20
retrieving revision 3.21
diff -u -d -r3.20 -r3.21
--- XKBBind.c	1 Feb 2004 16:16:03 -0000	3.20
+++ XKBBind.c	28 Jan 2005 18:48:07 -0000	3.21
@@ -363,7 +363,7 @@
 
 	if (xkbi->flags&XkbMapPending)
 	     changes= xkbi->changes;
-	else bzero(&changes,sizeof(XkbChangesRec));
+	else bzero(&changes,sizeof(changes));
 	XkbNoteMapChanges(&changes,event,XKB_XLIB_MAP_MASK);
 	LockDisplay(dpy);
 	if ((rtrn=XkbGetMapChanges(dpy,xkbi->desc,&changes))!=Success) {

Index: XKBCvt.c
===================================================================
RCS file: /cvs/xlibs/X11/src/XKBCvt.c,v
retrieving revision 3.36
retrieving revision 3.37
diff -u -d -r3.36 -r3.37
--- XKBCvt.c	1 Feb 2004 16:16:03 -0000	3.36
+++ XKBCvt.c	28 Jan 2005 18:48:07 -0000	3.37
@@ -213,10 +213,6 @@
  * an simplify integration by these companies.
  */
 
-#ifdef X11_DATADIR
-#define CHARSET_FILE X11_DATADIR "/input/charsets"
-#endif
-
 #ifndef CHARSET_FILE
 #define	CHARSET_FILE	"/usr/lib/X11/input/charsets"
 #endif

Index: XlibInt.c
===================================================================
RCS file: /cvs/xlibs/X11/src/XlibInt.c,v
retrieving revision 3.46
retrieving revision 3.47
diff -u -d -r3.46 -r3.47
--- XlibInt.c	16 Jun 2004 22:59:23 -0000	3.46
+++ XlibInt.c	28 Jan 2005 18:48:07 -0000	3.47
@@ -3427,5 +3427,22 @@
     return ret;
 }
 
+#undef _Xdebug
+int _Xdebug = 0;
+int *_Xdebug_p = &_Xdebug;
+void (**_XCreateMutex_fn_p)(LockInfoPtr) = &_XCreateMutex_fn;
+void (**_XFreeMutex_fn_p)(LockInfoPtr) = &_XFreeMutex_fn;
+void (**_XLockMutex_fn_p)(LockInfoPtr
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+    , char * /* file */
+    , int /* line */
 #endif
-
+        ) = &_XLockMutex_fn;
+void (**_XUnlockMutex_fn_p)(LockInfoPtr
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+    , char * /* file */
+    , int /* line */
+#endif
+        ) = &_XUnlockMutex_fn;
+LockInfoPtr *_Xglobal_lock_p = &_Xglobal_lock;
+#endif /* WIN32 */

Index: cmsCmap.c
===================================================================
RCS file: /cvs/xlibs/X11/src/cmsCmap.c,v
retrieving revision 3.4
retrieving revision 3.5
diff -u -d -r3.4 -r3.5
--- cmsCmap.c	5 Apr 2004 09:27:44 -0000	3.4
+++ cmsCmap.c	28 Jan 2005 18:48:07 -0000	3.5
@@ -40,6 +40,7 @@
 #include "Xlibint.h"
 #include "Xcmsint.h"
 #include "Xutil.h"
+#include "Cmap.h"
 #include "Cv.h"
 
 /*

Index: cmsColNm.c
===================================================================
RCS file: /cvs/xlibs/X11/src/cmsColNm.c,v
retrieving revision 3.14
retrieving revision 3.15
diff -u -d -r3.14 -r3.15
--- cmsColNm.c	5 Mar 2004 09:16:42 -0000	3.14
+++ cmsColNm.c	28 Jan 2005 18:48:07 -0000	3.15
@@ -51,10 +51,6 @@
  *      LOCAL DEFINES
  *		#define declarations local to this package.
  */
-#ifdef X11_DATADIR
-#define XCMSDB X11_DATADIR "/Xcms.txt"
-#endif
-
 #ifndef XCMSDB
 #define XCMSDB  "/usr/lib/X11/Xcms.txt"
 #endif

Index: imDefLkup.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imDefLkup.c,v
retrieving revision 3.12
retrieving revision 3.13
diff -u -d -r3.12 -r3.13
--- imDefLkup.c	1 Feb 2004 16:16:04 -0000	3.12
+++ imDefLkup.c	28 Jan 2005 18:48:07 -0000	3.13
@@ -463,7 +463,7 @@
     Xim			im = (Xim )ic->core.im;
     XWindowAttributes	atr;
 
-    if (!XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr))
+    if (!_XGetWindowAttributes(im->core.display, ic->core.focus_window, &atr))
 	return 0;
     return (EVENTMASK)atr.your_event_mask;
 }

Index: imInsClbk.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imInsClbk.c,v
retrieving revision 3.4
retrieving revision 3.5
diff -u -d -r3.4 -r3.5
--- imInsClbk.c	1 Feb 2004 16:16:04 -0000	3.4
+++ imInsClbk.c	28 Jan 2005 18:48:07 -0000	3.5
@@ -254,8 +254,6 @@
 		    _XUnregisterFilter( display, RootWindow(display, 0),
 					_XimFilterPropertyNotify,
 					(XPointer)NULL );
-		    XSelectInput( display, RootWindow(display, 0),
-				  NoEventMask );
 		}
 		else
 		    picb->next = icb->next;

Index: imLcFlt.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imLcFlt.c,v
retrieving revision 1.1.1.4
retrieving revision 1.2
diff -u -d -r1.1.1.4 -r1.2
--- imLcFlt.c	16 Jan 2001 22:11:30 -0000	1.1.1.4
+++ imLcFlt.c	28 Jan 2005 18:48:07 -0000	1.2
@@ -73,7 +73,7 @@
 	    ic->private.local.composed = p;
 	    /* return back to client KeyPressEvent keycode == 0 */
 	    ev->xkey.keycode = 0;
-	    XPutBackEvent(d, ev);
+	    _XPutBackEvent(d, ev);
 	    /* initialize internal state for next key sequence */
 	    ic->private.local.context = ((Xim)ic->core.im)->private.local.top;
 	    return(True);

Index: imRm.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imRm.c,v
retrieving revision 3.13
retrieving revision 3.14
diff -u -d -r3.13 -r3.14
--- imRm.c	1 Feb 2004 16:16:04 -0000	3.13
+++ imRm.c	28 Jan 2005 18:48:07 -0000	3.14
@@ -1860,11 +1860,11 @@
 		0,
 		0},
     {XNSpotLocation, 0,
-		0,
+		0, /*(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),*/,
 		(XIM_MODE_PRE_CREATE | XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
 		0,
-		0,
-		0,
+		(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
+		(XIM_MODE_PRE_SET | XIM_MODE_PRE_GET),
 		0,
 		0,
 		0,

Index: imThaiFlt.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imThaiFlt.c,v
retrieving revision 3.23
retrieving revision 3.24
diff -u -d -r3.23 -r3.24
--- imThaiFlt.c	29 Jun 2004 15:42:33 -0000	3.23
+++ imThaiFlt.c	28 Jan 2005 18:48:08 -0000	3.24
@@ -506,11 +506,12 @@
    (0<=(wc)&&(wc)<=0x7F) ? \
      (wc) : \
      ((0x0E01<=(wc)&&(wc)<=0x0E5F) ? ((wc)-0x0E00+0xA0) : 0))
+/* "c" is an unsigned char */
 #define tis2ucs(c)  \
   ( \
    ((c)<=0x7F) ? \
      (wchar_t)(c) : \
-     ((0x0A1<=(c)&&(c)<=0x0FF) ? ((wchar_t)(c)-0xA0+0x0E00) : 0))
+     ((0x0A1<=(c)) ? ((wchar_t)(c)-0xA0+0x0E00) : 0))
 
 /*
  * Macros to save and recall last input character in XIC

Index: imTrans.c
===================================================================
RCS file: /cvs/xlibs/X11/src/imTrans.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- imTrans.c	1 Feb 2004 16:16:04 -0000	1.6
+++ imTrans.c	28 Jan 2005 18:48:08 -0000	1.7
@@ -43,6 +43,9 @@
 #include "XimTrans.h"
 #include "XimTrInt.h"
 
+#ifdef WIN32
+#include <X11/Xwindows.h>
+#endif
 
 #ifndef XIM_CONNECTION_RETRIES
 #define XIM_CONNECTION_RETRIES 5

Index: lcEuc.c
===================================================================
RCS file: /cvs/xlibs/X11/src/lcEuc.c,v
retrieving revision 3.13
retrieving revision 3.14
diff -u -d -r3.13 -r3.14
--- lcEuc.c	22 Aug 2003 13:29:16 -0000	3.13
+++ lcEuc.c	28 Jan 2005 18:48:08 -0000	3.14
@@ -832,6 +832,8 @@
     wchar_t wch;
     Ulong wc_encoding;
     CTData ctdp = ctdata;
+    CTData GL_ctdp = ctdp;     /* GL ctdp save */
+    CTData GR_ctdp = ctdp;     /* GR ctdp save */
     Bool save_outbuf = True;
     /* If outbufptr is NULL, doen't save output, but just counts
        a length to hold the output */
@@ -840,6 +842,18 @@
     for (length = ctdata[Ascii].length; *from_left > 0; (*from_left) -= length)
     {
 	ct_type = CT_STD;
+	/* change GL/GR charset */
+	if(ctdp->side == XlcGR && isleftside(*inbufptr)){
+	    /* select GL side */
+	    ctdp = GL_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}else if(ctdp->side == XlcGL && isrightside(*inbufptr)){
+	    /* select GR side */
+	    ctdp = GR_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}
 	if (*inbufptr == '\033' || *inbufptr == (char)'\233') {
 	    for (ctdp = ctdata; ctdp <= ctd_endp ; ctdp++) {
 
@@ -856,6 +870,11 @@
 			}
 		    }
 		    ct_type = ctdp->ct_type;
+	            if(ctdp->side == XlcGL){
+	                GL_ctdp = ctdp; /* save GL ctdp */
+	            }else{
+	                GR_ctdp = ctdp; /* save GR ctdp */
+	            }
 		    break;
 		}
 	    }
@@ -1091,6 +1110,8 @@
     unsigned int ct_seglen = 0;
     Uchar ct_type = 0;
     CTData ctdp = &ctdata[0];	/* default */
+    CTData GL_ctdp = ctdp;     /* GL ctdp save */
+    CTData GR_ctdp = ctdp;     /* GR ctdp save */
     Bool save_outbuf = True;
     /* If outbufptr is NULL, doen't save output, but just counts
        a length to hold the output */
@@ -1099,6 +1120,18 @@
     for (length = ctdata[Ascii].length; *from_left > 0; (*from_left) -= length)
     {
 	ct_type = CT_STD;
+	/* change GL/GR charset */
+	if(ctdp->side == XlcGR && isleftside(*inbufptr)){
+	    /* select GL side */
+	    ctdp = GL_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}else if(ctdp->side == XlcGL && isrightside(*inbufptr)){
+	    /* select GR side */
+	    ctdp = GR_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}
 	if (*inbufptr == '\033' || *inbufptr == (char)'\233') {
 
 	    for (ctdp = ctdata; ctdp <= ctd_endp ; ctdp++) {
@@ -1116,6 +1149,11 @@
 			}
 		    }
 		    ct_type = ctdp->ct_type;
+	            if(ctdp->side == XlcGL){
+	                GL_ctdp = ctdp; /* save GL ctdp */
+	            }else{
+	                GR_ctdp = ctdp; /* save GR ctdp */
+	            }
 		    break;
 		}
 	    }

Index: lcFile.c
===================================================================
RCS file: /cvs/xlibs/X11/src/lcFile.c,v
retrieving revision 3.34
retrieving revision 3.35
diff -u -d -r3.34 -r3.35
--- lcFile.c	31 Oct 2003 23:43:06 -0000	3.34
+++ lcFile.c	28 Jan 2005 18:48:08 -0000	3.35
@@ -150,6 +150,42 @@
 
     return argc;
 }
+
+#elif defined(WIN32)
+
+/* this is parse_line but skips drive letters at the beginning of the entry */
+static int
+parse_line1(
+    char *line,
+    char **argv,
+    int argsize)
+{
+    int argc = 0;
+    char *p = line;
+
+    while (argc < argsize) {
+       while (isspace(*p)) {
+           ++p;
+       }
+       if (*p == '\0') {
+           break;
+       }
+       argv[argc++] = p;
+        if (isalpha(*p) && p[1] == ':') {
+            p+= 2; /* skip drive letters */
+        }
+       while (*p != ':' && *p != '\n' && *p != '\0') {
+           ++p;
+       }
+       if (*p == '\0') {
+           break;
+       }
+       *p++ = '\0';
+    }
+
+    return argc;
+}
+
 #endif   /* __UNIXOS2__ */
 
 /* Splits a colon separated list of directories, and returns the constituent
@@ -164,7 +200,7 @@
     char *p = path;
     int n, i;
 
-#ifndef __UNIXOS2__
+#if !defined(__UNIXOS2__) && !defined(WIN32)
     n = parse_line(path, argv, argsize);
 #else
     n = parse_line1(path, argv, argsize);
@@ -181,10 +217,6 @@
     return n;
 }
 
-#ifdef X11_DATADIR
-#define XLOCALEDIR X11_DATADIR "/locale"
-#endif
-
 #ifndef XLOCALEDIR
 #define XLOCALEDIR "/usr/lib/X11/locale"
 #endif
@@ -201,6 +233,7 @@
     char *dir;
     int priv = 1;
 
+#ifndef WIN32
     dir = getenv("XLOCALEDIR");
 
     if (dir) {
@@ -239,6 +272,9 @@
 	    }
 #endif
 	}
+#else
+    priv = 0;
+#endif
 	if (!priv) {
 	    len = strlen(dir);
 	    strncpy(p, dir, buf_len);
@@ -336,6 +372,42 @@
     return dst;
 }
 
+/*
+ * normalize_lcname(): remove any '_' and '-' and convert any character
+ * to lower case after the <language>_<territory> part. If result is identical
+ * to argument, free result and
+ * return NULL.
+ */
+static char *
+normalize_lcname (const char *name)
+{
+    char *p, *ret;
+    const char *tmp = name;
+
+    p = ret = Xmalloc(strlen(name) + 1);
+    if (!p)
+       return NULL;
+
+    if (tmp) {
+       while (*tmp && *tmp != '.' && *tmp != '@')
+           *p++ = *tmp++;
+       while (*tmp) {
+           if (*tmp != '-')
+               *p++ = c_tolower(*tmp);
+           tmp++;
+       }
+    }
+    *p = '\0';
+
+    if (strcmp(ret, name) == 0) {
+       Xfree(ret);
+       return NULL;
+    }
+
+    return ret;
+}
+
+
 /************************************************************************/
 char *
 _XlcFileName(
@@ -404,6 +476,7 @@
     char *args[NUM_LOCALEDIR];
     static const char locale_alias[] = LOCALE_ALIAS;
     char *tmp_siname;
+    char *nlc_name = NULL;
 
     xlocaledir (dir, PATH_MAX);
     n = _XlcParsePath(dir, args, NUM_LOCALEDIR);
@@ -413,11 +486,19 @@
 	    sprintf (buf, "%s/%s", args[i], locale_alias);
 	    name = resolve_name (lc_name, buf, LtoR);
 	}
+	if (!name) {
+	    if (!nlc_name)
+	        nlc_name = normalize_lcname(lc_name);
+	    if (nlc_name)
+	        name = resolve_name (nlc_name, buf, LtoR);
+	}
 	if (name != NULL) {
 	    break;
 	}
     }
 
+    if (nlc_name) Xfree(nlc_name);
+
     if (name == NULL) {
 	/* vendor locale name == Xlocale name, no expansion of alias */
 	pub->siname = Xmalloc (strlen (lc_name) + 1);
@@ -491,6 +572,7 @@
     static char locale_alias[] = LOCALE_ALIAS;
     char *target_name = (char*)0;
     char *target_dir = (char*)0;
+    char *nlc_name = NULL;
 
     xlocaledir (dir, PATH_MAX);
     n = _XlcParsePath(dir, args, 256);
@@ -500,12 +582,18 @@
  	     strlen(locale_alias)) < PATH_MAX) {
  	    sprintf (buf, "%s/%s", args[i], locale_alias);
  	    name = resolve_name(lc_name, buf, LtoR);
+            if (!name) {
+                if (!nlc_name)
+                    nlc_name = normalize_lcname(lc_name);
+                if (nlc_name)
+                    name = resolve_name (nlc_name, buf, LtoR);
+            }
  	}
   
  	/* If name is not an alias, use lc_name for locale.dir search */
  	if (name == NULL)
  	    name = lc_name;
- 
+
  	/* look at locale.dir */
  
  	target_dir = args[i];
@@ -533,6 +621,9 @@
  	}
  	name = NULL;
     }
+
+    if (nlc_name) Xfree(nlc_name);
+
     if (target_name == NULL) {
  	/* vendor locale name == Xlocale name, no expansion of alias */
  	target_dir = args[0];

Index: lcSjis.c
===================================================================
RCS file: /cvs/xlibs/X11/src/lcSjis.c,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -d -r3.10 -r3.11
--- lcSjis.c	20 Jan 2003 04:05:31 -0000	3.10
+++ lcSjis.c	28 Jan 2005 18:48:08 -0000	3.11
@@ -991,6 +991,13 @@
 	    ct_state.GR_charset = charset;
 	else if (charset->side == XlcGL)
 	    ct_state.GL_charset = charset;
+
+	if (charset->side == XlcGR) {
+	    clen = charset->length;
+	    do {
+	        (*(Uchar *)(ctptr-clen)) = BIT8ON(*(Uchar *)(ctptr-clen));
+	    } while (--clen);
+	}
     }
 
     *to = (XPointer)ctptr;
@@ -1147,6 +1154,8 @@
     unsigned int ct_seglen = 0;
     Uchar ct_type;
     CTData ctdp = ctdata;	/* default */
+    CTData GL_ctdp = ctdp;     /* GL ctdp save */
+    CTData GR_ctdp = ctdp;     /* GR ctdp save */
 
     if (*from_left > *to_left)
 	*from_left = *to_left;
@@ -1154,6 +1163,18 @@
     for (length = ctdata[Ascii].length; *from_left > 0 ; (*from_left) -= length)
     {
 	ct_type = CT_STD;
+	/* change GL/GR charset */
+	if(ctdp->side == XlcGR && isleftside(*inbufptr)){
+	    /* select GL side */
+	    ctdp = GL_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}else if(ctdp->side == XlcGL && isrightside(*inbufptr)){
+	    /* select GR side */
+	    ctdp = GR_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}
 	if (*inbufptr == '\033' || *inbufptr == (char)'\233') {
 
 	    for (ctdp = ctdata; ctdp <= ctd_endp ; ctdp++) {
@@ -1171,6 +1192,11 @@
 			}
 		    }
 		    ct_type = ctdp->ct_type;
+	            if(ctdp->side == XlcGL){
+	                GL_ctdp = ctdp; /* save GL ctdp */
+	            }else{
+	                GR_ctdp = ctdp; /* save GR ctdp */
+	            }
 		    break;
 		}
 	    }
@@ -1265,6 +1291,8 @@
     wchar_t wch;
     Ulong wc_encoding;
     CTData ctdp = ctdata;
+    CTData GL_ctdp = ctdp;     /* GL ctdp save */
+    CTData GR_ctdp = ctdp;     /* GR ctdp save */
 
     if (*from_left > *to_left)
 	*from_left = *to_left;
@@ -1272,6 +1300,18 @@
     for (length = ctdata[Ascii].length; *from_left > 0; (*from_left) -= length )
     {
 	ct_type = CT_STD;
+	/* change GL/GR charset */
+	if(ctdp->side == XlcGR && isleftside(*inbufptr)){
+	    /* select GL side */
+	    ctdp = GL_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}else if(ctdp->side == XlcGL && isrightside(*inbufptr)){
+	    /* select GR side */
+	    ctdp = GR_ctdp;
+	    length = ctdp->length;
+	    ct_type = ctdp->ct_type;
+	}
 	if (*inbufptr == '\033' || *inbufptr == (char)'\233') {
 	    for (ctdp = ctdata; ctdp <= ctd_endp ; ctdp++) {
 
@@ -1288,6 +1328,11 @@
 			}
 		    }
 		    ct_type = ctdp->ct_type;
+	            if(ctdp->side == XlcGL){
+	                GL_ctdp = ctdp; /* save GL ctdp */
+	            }else{
+	                GR_ctdp = ctdp; /* save GR ctdp */
+	            }
 		    break;
 		}
 	    }

Index: lcUTF8.c
===================================================================
RCS file: /cvs/xlibs/X11/src/lcUTF8.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- lcUTF8.c	27 Jun 2004 22:31:31 -0000	1.17
+++ lcUTF8.c	28 Jan 2005 18:48:08 -0000	1.18
@@ -1750,7 +1750,13 @@
         }
 	while (count-- > 0) {
 	    XlcCharSet charset = _XlcGetCharSet(*value++);
-	    const char *name = charset->encoding_name;
+	    const char *name;
+
+	    if (charset == (XlcCharSet) NULL)
+	        continue;
+
+	    name = charset->encoding_name;
+
 	    /* If it wasn't already encountered... */
 	    for (k = num - 1; k >= 0; k--)
 		if (!strcmp(preferred[k]->name, name))

Index: omGeneric.c
===================================================================
RCS file: /cvs/xlibs/X11/src/omGeneric.c,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -d -r3.28 -r3.29
--- omGeneric.c	1 Feb 2004 16:16:04 -0000	3.28
+++ omGeneric.c	28 Jan 2005 18:48:08 -0000	3.29
@@ -1055,6 +1055,7 @@
 		      return True;
 		  }
 		  Xfree(font_data->xlfd_name);
+		  font_data->xlfd_name = NULL;
 		  return False;
 	       }
 	       break;



More information about the xlibs-commit mailing list