# HG changeset patch # User Aidan Kehoe # Date 1244305221 -3600 # Node ID 8cef85a39d2c162abd60427022511be52b9880b3 # Parent 7757334005ae068d65d4ebca5c4f108af53c21a3 Make CDPATH handling portable, accept entries not matching "/$". 2009-06-06 Aidan Kehoe * files.el (cd): Make CDPATH handling portable, accept entries without trailing slashes within it. Some style corrections from Stephen Turnbull, thank you Stephen. diff -r 7757334005ae -r 8cef85a39d2c lisp/ChangeLog --- a/lisp/ChangeLog Sat Jun 06 12:59:31 2009 +0100 +++ b/lisp/ChangeLog Sat Jun 06 17:20:21 2009 +0100 @@ -1,3 +1,10 @@ +2009-06-06 Aidan Kehoe + + * files.el (cd): + Make CDPATH handling portable, accept entries without trailing + slashes within it. Some style corrections from Stephen Turnbull, + thank you Stephen. + 2009-05-29 Aidan Kehoe * bytecomp.el (byte-compile-lambda): diff -r 7757334005ae -r 8cef85a39d2c lisp/files.el --- a/lisp/files.el Sat Jun 06 12:59:31 2009 +0100 +++ b/lisp/files.el Sat Jun 06 17:20:21 2009 +0100 @@ -595,12 +595,13 @@ (null (getenv "CDPATH")))))) (if (file-name-absolute-p dir) (cd-absolute (expand-file-name dir)) - ;; XEmacs + ;; 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)) - ;;#### Unix-specific - (let ((trypath (parse-colon-path - (setq cdpath-previous (getenv "CDPATH"))))) - (setq cd-path (or trypath (list "./"))))) + (let ((trypath (split-path (setq cdpath-previous (getenv "CDPATH"))))) + (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))))