summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-31 08:07:41 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-31 08:07:41 -0700
commit25cc0f2aada3e321e5f1c6d1e492a93d16da45b2 (patch)
tree05309a9d1d74813cf25073015ef7aaf36d7a36bf /lisp/subr.el
parent4efef3db2fb1c3a20b83a67948e614d9b0c258dd (diff)
parent788c9b69e1801dd883dbe603281571ef3c78a724 (diff)
downloademacs-25cc0f2aada3e321e5f1c6d1e492a93d16da45b2.tar.gz
emacs-25cc0f2aada3e321e5f1c6d1e492a93d16da45b2.tar.bz2
emacs-25cc0f2aada3e321e5f1c6d1e492a93d16da45b2.zip
Merge from origin/emacs-25
788c9b6 ; Spelling fix 25c4a30 * lisp/recentf.el (recentf-dialog-mode-map): Remove follow-li... 0992ec3 Correct cl-flet usage (Bug#22317) 50caae3 Release MH-E manual version 8.6 602bb40 Update MH-E's documentation about HTML renderers 89018f0 Fx the we->the typo 845ee57 Restore frames into the current display by default ee28b4c * lisp/recentf.el (recentf-open-files-item): Quick fix for (b... 01c3cd1 etc/TODO: Remove out-of-place issue 5e18486 Clarify doc string of 'file-name-sans-extension' bffda22 Fix the MSDOS build f907f98 * lisp/progmodes/elisp-mode.el (elisp-function-argstring): Ca... 1a2ffd0 * src/dired.c (Ffile_name_all_completions): Doc fix. (Bug#23... f7ffc4b Fix infloop in 'number-sequence' 4ab2673 ; Spelling and punctuation fixes in comments 71c152e * lisp/emacs-lisp/find-func.el (find-function-library):
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 6e679e70f7e..b66ff288b7a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -486,13 +486,16 @@ of course, also replace TO with a slightly larger value
(list from)
(or inc (setq inc 1))
(when (zerop inc) (error "The increment can not be zero"))
- (let (seq (n 0) (next from))
+ (let (seq (n 0) (next from) (last from))
(if (> inc 0)
- (while (<= next to)
+ ;; The (>= next last) condition protects against integer
+ ;; overflow in computing NEXT.
+ (while (and (>= next last) (<= next to))
(setq seq (cons next seq)
n (1+ n)
+ last next
next (+ from (* n inc))))
- (while (>= next to)
+ (while (and (<= next last) (>= next to))
(setq seq (cons next seq)
n (1+ n)
next (+ from (* n inc)))))