emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3a2eee6 2/2: Fix string-glyph-split infloop


From: Lars Ingebrigtsen
Subject: master 3a2eee6 2/2: Fix string-glyph-split infloop
Date: Wed, 24 Nov 2021 02:31:15 -0500 (EST)

branch: master
commit 3a2eee6f7439866ac51d0d4c7b43f7f9f6f88fe2
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix string-glyph-split infloop
    
    * lisp/emacs-lisp/subr-x.el (string-glyph-split): Fix infloop when
    applied to (string-glyph-split "✈️🌍") (bug#52067).
---
 lisp/emacs-lisp/subr-x.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index b2dae56..95254b9 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -456,7 +456,12 @@ This takes into account combining characters and grapheme 
clusters."
         (start 0)
         comp)
     (while (< start (length string))
-      (if (setq comp (find-composition-internal start nil string nil))
+      (if (setq comp (find-composition-internal
+                      start
+                      ;; Don't search backward in the string for the
+                      ;; start of the composition.
+                      (min (length string) (1+ start))
+                      string nil))
           (progn
             (push (substring string (car comp) (cadr comp)) result)
             (setq start (cadr comp)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]