diff options
| author | Eli Zaretskii | 2011-08-23 11:38:29 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-08-23 11:38:29 +0300 |
| commit | 425cc014ac9191debe8c01dc360685486bba0ff1 (patch) | |
| tree | 7c2019419fcb00eb1a4e89b8b0a7c3026458692d /src | |
| parent | 1a2e6670cf53a76bfd134c8453f81a2de8c6ea5c (diff) | |
| download | emacs-425cc014ac9191debe8c01dc360685486bba0ff1.tar.gz emacs-425cc014ac9191debe8c01dc360685486bba0ff1.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ffb8dd76366..d4f654a1028 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-08-23 Eli Zaretskii <eliz@gnu.org> | 1 | 2011-08-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos | ||
| 4 | instead of CHAR_TO_BYTE. Fixes a crash when a completion | ||
| 5 | candidate is selected by the mouse, and that candidate has a | ||
| 6 | composed character under the mouse. | ||
| 7 | |||
| 3 | * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel | 8 | * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel |
| 4 | coordinates reported by pos-visible-in-window-p for a composed | 9 | coordinates reported by pos-visible-in-window-p for a composed |
| 5 | character in column zero. | 10 | character in column zero. |
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 | |||
| 5307 | if (STRINGP (it.string)) | 5307 | if (STRINGP (it.string)) |
| 5308 | BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); | 5308 | BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); |
| 5309 | else | 5309 | else |
| 5310 | BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); | 5310 | BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), |
| 5311 | CHARPOS (pos->pos)); | ||
| 5311 | } | 5312 | } |
| 5312 | 5313 | ||
| 5313 | #ifdef HAVE_WINDOW_SYSTEM | 5314 | #ifdef HAVE_WINDOW_SYSTEM |