From f2016beaf388cab00ab1cef9c52f7790115a2da3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 12 Sep 2012 20:18:33 +0300 Subject: [PATCH] Fix a typo that caused crashes in redisplay. src/xdisp.c (compute_stop_pos_backwards): Fix a typo that caused crashes while scrolling through multibyte text. --- src/ChangeLog | 2 ++ src/xdisp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 39bdd191188..6b5b6e1455d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,8 @@ that fails, clear the desired glyph matrix before returning a failure indication to the caller. Fixes leaving garbled display when fast scrolling with a down-key. (Bug#12403) + (compute_stop_pos_backwards): Fix a typo that caused crashes while + scrolling through multibyte text. 2012-09-12 Jan Djärv diff --git a/src/xdisp.c b/src/xdisp.c index 3fab4b54cf0..c5962541cb6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7669,7 +7669,7 @@ compute_stop_pos_backwards (struct it *it) { it->end_charpos = min (charpos + 1, ZV); charpos = max (charpos - SCAN_BACK_LIMIT, BEGV); - SET_TEXT_POS (pos, charpos, BYTE_TO_CHAR (charpos)); + SET_TEXT_POS (pos, charpos, CHAR_TO_BYTE (charpos)); reseat_1 (it, pos, 0); compute_stop_pos (it); /* We must advance forward, right? */ -- 2.11.4.GIT