diff options
author | Eli Zaretskii <eliz@gnu.org> | 2011-08-23 11:38:29 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2011-08-23 11:38:29 +0300 |
commit | 425cc014ac9191debe8c01dc360685486bba0ff1 (patch) | |
tree | 7c2019419fcb00eb1a4e89b8b0a7c3026458692d /src/dispnew.c | |
parent | 1a2e6670cf53a76bfd134c8453f81a2de8c6ea5c (diff) | |
download | emacs-425cc014ac9191debe8c01dc360685486bba0ff1.tar.gz |
Fix crashes with completion and composed characters.
src/dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
instead of CHAR_TO_BYTE. Fixes a crash when a completion
candidate is selected by the mouse, and that candidate has a
composed character under the mouse.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index fadfbb26603..e2bcf5d7090 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5307,7 +5307,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p if (STRINGP (it.string)) BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); else - BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); + BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), + CHARPOS (pos->pos)); } #ifdef HAVE_WINDOW_SYSTEM |