From: Richard M. Stallman Date: Fri, 12 Jan 2001 19:51:09 +0000 (+0000) Subject: (last): Handle a list that doesn't end in nil. X-Git-Tag: emacs-pretest-21.0.96~311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6bfdc2e29f72fda0bb19ee78daf625e2224e27ce;p=emacs.git (last): Handle a list that doesn't end in nil. --- diff --git a/lisp/subr.el b/lisp/subr.el index 3a60e15b0e5..2d6a72a6ac5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -131,7 +131,7 @@ If N is bigger than the length of X, return X." (setq m (1+ m) p (cdr p))) (if (<= n 0) p (if (< n m) (nthcdr (- m n) x) x))) - (while (cdr x) + (while (consp (cdr x)) (setq x (cdr x))) x))