aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorStephen Berman <[email protected]>2010-10-14 01:15:03 +0200
committerJuanma Barranquero <[email protected]>2010-10-14 01:15:03 +0200
commit88f427d57c2d21b0dcb9ecae03b18f52e8509a1e (patch)
treeec202567e5bd7856d1c9b70771d06374ea48d89f /lisp/subr.el
parentd1090fe81cb9fed04d3564a17ff9445b70d9f092 (diff)
lisp/subr.el (last): Use `safe-length' instead of `length' (bug#7206).
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 0ed4ae6279..dabadec770 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -290,10 +290,10 @@ If N is non-nil, return the Nth-to-last link of LIST.
If N is bigger than the length of LIST, return LIST."
(if n
(and (> n 0)
- (let ((m (length list)))
+ (let ((m (safe-length list)))
(if (< n m) (nthcdr (- m n) list) list)))
(and list
- (nthcdr (1- (length list)) list))))
+ (nthcdr (1- (safe-length list)) list))))
(defun butlast (list &optional n)
"Return a copy of LIST with the last N elements removed."