diff lisp/files.el @ 4640:8cef85a39d2c

Make CDPATH handling portable, accept entries not matching "/$". 2009-06-06 Aidan Kehoe <kehoea@parhasard.net> * files.el (cd): Make CDPATH handling portable, accept entries without trailing slashes within it. Some style corrections from Stephen Turnbull, thank you Stephen.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 06 Jun 2009 17:20:21 +0100
parents 555e21a66d51
children f2a991ff6db0
line wrap: on
line diff
--- 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))))