diff options
| author | Eli Zaretskii | 2010-04-27 22:40:05 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-27 22:40:05 +0300 |
| commit | 4fc85283057936715d48842ec8f89ae146b1e8d7 (patch) | |
| tree | aca940c42605f449fc5dfee7b3fef7dbcbb3efe6 /src | |
| parent | 7482731ab522e6c0667fcf1b60bc9b5c1ba6ffca (diff) | |
| download | emacs-4fc85283057936715d48842ec8f89ae146b1e8d7.tar.gz emacs-4fc85283057936715d48842ec8f89ae146b1e8d7.zip | |
Fix a crash when a display string is continued to the next line.
xdisp.c (set_cursor_from_row): When looping over a display string,
don't overstep the end of the glyph row.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9cabe8de38b..a6a89a4ea3b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-04-27 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix a crash when a display string | ||
| 4 | is continued to the next line. | ||
| 5 | |||
| 1 | 2010-04-25 Eli Zaretskii <eliz@gnu.org> | 6 | 2010-04-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * xdisp.c (set_cursor_from_row): Don't return zero if cursor was | 8 | * xdisp.c (set_cursor_from_row): Don't return zero if cursor was |
diff --git a/src/xdisp.c b/src/xdisp.c index d491d5a9aeb..9e14f7879a2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13015,7 +13015,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 13015 | 13015 | ||
| 13016 | cursor = glyph; | 13016 | cursor = glyph; |
| 13017 | for (glyph += incr; | 13017 | for (glyph += incr; |
| 13018 | EQ (glyph->object, str); | 13018 | (row->reversed_p ? glyph > stop : glyph < stop) |
| 13019 | && EQ (glyph->object, str); | ||
| 13019 | glyph += incr) | 13020 | glyph += incr) |
| 13020 | { | 13021 | { |
| 13021 | Lisp_Object cprop; | 13022 | Lisp_Object cprop; |
| @@ -13056,8 +13057,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 13056 | /* If we reached the end of the line, and END was from a string, | 13057 | /* If we reached the end of the line, and END was from a string, |
| 13057 | the cursor is not on this line. */ | 13058 | the cursor is not on this line. */ |
| 13058 | if (cursor == NULL | 13059 | if (cursor == NULL |
| 13059 | && glyph == end | 13060 | && (row->reversed_p ? glyph <= end : glyph >= end) |
| 13060 | && STRINGP ((glyph - incr)->object) | 13061 | && STRINGP (end->object) |
| 13061 | && row->continued_p) | 13062 | && row->continued_p) |
| 13062 | return 0; | 13063 | return 0; |
| 13063 | } | 13064 | } |