bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: utf-8 input under X11


From: Gerd Moellmann
Subject: Re: utf-8 input under X11
Date: 26 Oct 2001 16:36:51 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

gerd.moellmann@t-online.de (Gerd Moellmann) writes:

> That it no longer crashes with this patch could mean that the number
> of chars `nchars' returned by decode_coding above the code block in
> the patch is different from the number of chars put into the input
> buffer in the for loop, which is guided by the `nbytes' returned from
> decode_coding.

We could test that assumption with the patch below.  It should abort
if `nchars' is really different from the number of characters stored
in the input buffer.  Could you please check?  (It's for the original
xterm.c before the first patch.)

*** xterm.c     2001/10/26 14:33:39     1.670
--- xterm.c     2001/10/26 14:34:53
***************
*** 10591,10597 ****
  
                          /* Convert the input data to a sequence of
                             character events.  */
!                         for (i = 0; i < nbytes; i += len)
                            {
                              c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
                                                          nbytes - i, len);
--- 10591,10600 ----
  
                          /* Convert the input data to a sequence of
                             character events.  */
!                         {
!                           int nevents = 0;
!                           
!                           for (i = 0; i < nbytes; i += len)
                            {
                              c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
                                                          nbytes - i, len);
***************
*** 10606,10615 ****
                                                          modifiers);
                              bufp->timestamp = event.xkey.time;
                              bufp++;
                            }
  
!                         count += nchars;
!                         numchars -= nchars;
  
                          if (keysym == NoSymbol)
                            break;
--- 10609,10622 ----
                                                          modifiers);
                              bufp->timestamp = event.xkey.time;
                              bufp++;
+                             ++nevents;
                            }
  
!                           if (nevents != nchars)
!                             abort ();
!                           count += nchars;
!                           numchars -= nchars;
!                         }
  
                          if (keysym == NoSymbol)
                            break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]