From 8b52e892668a30330140f485071b7ffba14d13aa Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 4 Mar 1998 07:42:24 +0000 Subject: [PATCH] (sref): Increase CHAR in the while loop. --- lisp/subr.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/subr.el b/lisp/subr.el index 2d55e682d3a..c14a048fb52 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -516,7 +516,8 @@ as returned by the `event-start' and `event-end' functions." Please convert your programs to use `aref' with character-base index." (let ((byte 0) (char 0)) (while (< byte byte-index) - (setq byte (+ byte (char-bytes (aref string byte))))) + (setq byte (+ byte (char-bytes (aref string char))) + char (1+ char))) (aref string char))) ;; Some programs still use this as a function. -- 2.39.2