diff src/event-Xt.c @ 367:a4f53d9b3154 r21-1-13

Import from CVS: tag r21-1-13
author cvs
date Mon, 13 Aug 2007 11:01:07 +0200
parents 30d2cfa1092a
children cc15677e0335
line wrap: on
line diff
--- a/src/event-Xt.c	Mon Aug 13 11:00:13 2007 +0200
+++ b/src/event-Xt.c	Mon Aug 13 11:01:07 2007 +0200
@@ -772,7 +772,11 @@
   
 #ifdef HAVE_XIM
   int len;
-  char buffer[64];
+  /* Some implementations of XmbLookupString don't return
+     XBufferOverflow correctly, so increase the size of the xim input
+     buffer from 64 to the more reasonable size 513, as Emacs has done.
+     From Kenichi Handa. */
+  char buffer[513];
   char *bufptr = buffer;
   int   bufsiz = sizeof (buffer);
   Status status;
@@ -1119,10 +1123,11 @@
 	    Lisp_Object l_dndlist = Qnil, l_item = Qnil;
 	    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
-	    GCPRO4 (l_type, l_data, l_dndlist, l_item);
-
 	    if (! frame)
 	      return 0;	/* not for us */
+
+	    GCPRO4 (l_type, l_data, l_dndlist, l_item);
+
 	    XSETFRAME (emacs_event->channel, frame);
 
 	    emacs_event->event_type = misc_user_event;