Commit bb4a52db authored by Jason Rumney's avatar Jason Rumney
Browse files

(make-directory): Stop recursing if parent is self. (Bug#2309)

parent 33ee2fc8
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment