From: Gerd Moellmann Date: Mon, 29 Oct 2001 09:45:37 +0000 (+0000) Subject: (XTread_socket) : Don't use X-Git-Tag: emacs-21.2~431 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d5c9792f787f981ebfdc3ecafb135e2fd07ab9c;p=emacs.git (XTread_socket) : Don't use STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa . --- diff --git a/src/xterm.c b/src/xterm.c index d18f671a108..8399f8b6c1a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10578,8 +10578,12 @@ XTread_socket (sd, bufp, numchars, expected) character events. */ for (i = 0; i < nbytes; i += len) { - c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, - nbytes - i, len); + if (nchars == nbytes) + c = copy_bufptr[i], len = 1; + else + c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, + nbytes - i, len); + bufp->kind = (SINGLE_BYTE_CHAR_P (c) ? ascii_keystroke : multibyte_char_keystroke);