]> git.eshelyaron.com Git - emacs.git/commitdiff
(make-directory): Stop recursing if parent is self. (Bug#2309)
authorJason Rumney <jasonr@gnu.org>
Tue, 17 Feb 2009 14:27:28 +0000 (14:27 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 17 Feb 2009 14:27:28 +0000 (14:27 +0000)
lisp/files.el

index fd4d05b6577bb8f6994fcea156534ff7ecf24e55..da8db21274b9df046a1af5507720db4a81a3684f 100644 (file)
@@ -4541,7 +4541,12 @@ this happens by default."
          (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