diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-24 08:27:22 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-24 08:27:22 +0100 |
commit | 3a2eee6f7439866ac51d0d4c7b43f7f9f6f88fe2 (patch) | |
tree | 0c1729e06c359cd3822effdfbaaaa56ca46f5146 /lisp/emacs-lisp | |
parent | d63fc69b192a608f98c15d6014430f28138fd82e (diff) | |
download | emacs-3a2eee6f7439866ac51d0d4c7b43f7f9f6f88fe2.tar.gz emacs-3a2eee6f7439866ac51d0d4c7b43f7f9f6f88fe2.tar.bz2 emacs-3a2eee6f7439866ac51d0d4c7b43f7f9f6f88fe2.zip |
Fix string-glyph-split infloop
* lisp/emacs-lisp/subr-x.el (string-glyph-split): Fix infloop when
applied to (string-glyph-split "✈️🌍") (bug#52067).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index b2dae564c2b..95254b946e5 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))) |