changeset 102070:68388ae40468

(make-directory): Stop recursing if parent is self. (Bug#2309)
author Jason Rumney <jasonr@gnu.org>
date Tue, 17 Feb 2009 14:27:28 +0000
parents b6ec92c16c1d
children e25fb73b6868
files lisp/files.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Feb 17 10:59:12 2009 +0000
+++ b/lisp/files.el	Tue Feb 17 14:27:28 2009 +0000
@@ -4541,7 +4541,12 @@
 	  (make-directory-internal dir)
 	(let ((dir (directory-file-name (expand-file-name dir)))
 	      create-list)
-	  (while (not (file-exists-p dir))
+	  (while (and (not (file-exists-p dir))
+		      ;; If directory is its own parent, then we can't
+		      ;; keep looping forever
+		      (not (equal dir
+				  (directory-file-name
+				   (file-name-directory dir)))))
 	    (setq create-list (cons dir create-list)
 		  dir (directory-file-name (file-name-directory dir))))
 	  (while create-list