lisp/subr.el (last): Deal with dotted lists (reported in bug#7174).
This commit is contained in:
parent
88f427d57c
commit
10e4702abc
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2010-10-13 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* subr.el (last): Deal with dotted lists (reported in bug#7174).
|
||||
|
||||
2010-10-13 Stephen Berman <stephen.berman@gmx.net>
|
||||
|
||||
* subr.el (last): Use `safe-length' instead of `length' (bug#7206).
|
||||
|
|
|
@ -289,7 +289,7 @@ If LIST is nil, return nil.
|
|||
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)
|
||||
(and (>= n 0)
|
||||
(let ((m (safe-length list)))
|
||||
(if (< n m) (nthcdr (- m n) list) list)))
|
||||
(and list
|
||||
|
|
Loading…
Add table
Reference in a new issue