From 138e541fe66054e57dbe9332cf6be36c72904bc2 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 26 Apr 2000 17:34:37 +0000 Subject: [PATCH] (normal-top-level-add-to-load-path): Handle case that the default directory is not in load-path. --- lisp/startup.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index 230988f2104..e2b227c7bfe 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -382,11 +382,15 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (let ((tail load-path) (thisdir (directory-file-name default-directory))) (while (and tail + ;;Don't go all the way to the nil terminator. + (cdr tail) (not (equal thisdir (car tail))) (not (and (memq system-type '(ms-dos windows-nt)) (equal (downcase thisdir) (downcase (car tail)))))) (setq tail (cdr tail))) - (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail))))) + ;;Splice the new section in. + (when tail + (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail)))))) (defun normal-top-level () (if command-line-processed -- 2.39.5