changeset: 4645:f2a991ff6db0
tag: tip
user: Jerry James <james(a)xemacs.org>
date: Mon Jun 29 08:20:47 2009 -0600
files: lisp/ChangeLog lisp/files.el
description:
Do not #'split-path on nil #'getenv result. <877hz7lzrt.fsf(a)yahoo.com.cn>
diff -r b0ae008bf1a0 -r f2a991ff6db0 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Jun 20 04:07:12 2009 +0900
+++ b/lisp/ChangeLog Mon Jun 29 08:20:47 2009 -0600
@@ -1,3 +1,7 @@
+2009-06-20 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
+ * files.el (cd): Do not #'split-path on nil #'getenv result; Make
+ sure the cd-path value is a list.
+
2009-06-14 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el (describe-function-1):
diff -r b0ae008bf1a0 -r f2a991ff6db0 lisp/files.el
--- a/lisp/files.el Sat Jun 20 04:07:12 2009 +0900
+++ b/lisp/files.el Mon Jun 29 08:20:47 2009 -0600
@@ -593,29 +593,33 @@
default-directory default-directory
(and (member cd-path '(nil ("./")))
(null (getenv "CDPATH"))))))
- (if (file-name-absolute-p dir)
- (cd-absolute (expand-file-name dir))
- ;; XEmacs change. I'm not sure respecting CDPATH is the right thing to
- ;; do under Windows.
- (unless (and cd-path (equal (getenv "CDPATH") cdpath-previous))
- (let ((trypath (split-path (setq cdpath-previous (getenv "CDPATH")))))
- (setq cd-path (or (and trypath
+
+ (let* ((cdpath-current (getenv "CDPATH"))
+ (trypath (if cdpath-current
+ (split-path (setq cdpath-previous cdpath-current))
+ nil))) ; null list
+ (if (file-name-absolute-p dir)
+ (cd-absolute (expand-file-name dir))
+ ;; XEmacs change. I'm not sure respecting CDPATH is the right thing to
+ ;; do under Windows.
+ (unless (and cd-path (equal cdpath-current cdpath-previous))
+ (setq cd-path (or (and trypath
(mapcar #'file-name-as-directory trypath))
- (file-name-as-directory "")))))
- (or (catch 'found
- (mapcar #'(lambda (x)
- (let ((f (expand-file-name (concat x dir))))
+ (list (file-name-as-directory "")))))
+ (or (catch 'found
+ (mapcar #'(lambda (x)
+ (let ((f (expand-file-name (concat x dir))))
(if (file-directory-p f)
(progn
- (cd-absolute f)
- (throw 'found t)))))
- cd-path)
- nil)
- ;; jwz: give a better error message to those of us with the
- ;; good taste not to use a kludge like $CDPATH.
- (if (equal cd-path '("./"))
- (error "No such directory: %s" (expand-file-name dir))
- (error "Directory not found in $CDPATH: %s" dir)))))
+ (cd-absolute f)
+ (throw 'found t)))))
+ cd-path)
+ nil)
+ ;; jwz: give a better error message to those of us with the
+ ;; good taste not to use a kludge like $CDPATH.
+ (if (equal cd-path '("./"))
+ (error "No such directory: %s" (expand-file-name dir))
+ (error "Directory not found in $CDPATH: %s" dir))))))
(defun load-file (file)
"Load the Lisp file named FILE."
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches