branch: externals/pabbrev
commit 6e3c38e3e1d27ffc45568173e21869d58615038f
Author: Phillip Lord <[email protected]>
Commit: Phillip Lord <[email protected]>

    Safe access of subsequence.
    
    Emacs 25 crashes when the indexes for cl-subseq are out-of-bounds, while
    previous Emacs silently ignored. Better to handle this here.
---
 pabbrev.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pabbrev.el b/pabbrev.el
index 0b1a2d2..5b8056b 100644
--- a/pabbrev.el
+++ b/pabbrev.el
@@ -1193,7 +1193,9 @@ It crashes under the same circumstances. Yeech."
       (subseq sequence from
               (min to
                    (length sequence)))
-    (cl-subseq sequence from to)))
+    (cl-subseq sequence
+               (min 0 from)
+               (min (length sequence) to))))
 
 (defvar pabbrev-select-mode-map
   (let ((map (make-sparse-keymap)))

Reply via email to