aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJason Rumney <[email protected]>2009-02-17 14:27:28 +0000
committerJason Rumney <[email protected]>2009-02-17 14:27:28 +0000
commitbb4a52db9ff6752f44849b7e411dd5d783c12d3f (patch)
treef902ad6c2895c8bd41c5edc2192377b96c2ce5a2 /lisp
parent33ee2fc873ce628b43ff47ce43d37d83c515d582 (diff)
(make-directory): Stop recursing if parent is self. (Bug#2309)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index fd4d05b657..da8db21274 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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