summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-02-16 18:16:55 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-02-16 18:16:55 +0000
commit6b99fa736f1b3e2b66cad76ba4ce8408969d8814 (patch)
treed3a7e2cabde49a80d83f31573cd98d8c7c239903
parent0a0d3143b801fc6b723020a1a12e569b56982e75 (diff)
downloademacs-6b99fa736f1b3e2b66cad76ba4ce8408969d8814.tar.gz
(vc-find-root): Don't loop forever on non-existent root.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc-hooks.el2
2 files changed, 5 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a92d8d16c73..ccf112e0da6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-16 Eli Zaretskii <eliz@gnu.org>
+
+ * vc-hooks.el (vc-find-root): Don't loop forever on non-existent root.
+
2008-02-14 Stefan Monnier <monnier@pastel.home>
* textmodes/sgml-mode.el (sgml-mode): Fix comment syntax.
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 64a7d8f527a..38ad7b5ea83 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -316,7 +316,7 @@ The function walks up the directory tree from FILE looking for WITNESS.
If WITNESS if not found, return nil, otherwise return the root."
;; Represent /home/luser/foo as ~/foo so that we don't try to look for
;; witnesses in /home or in /.
- (while (not (file-directory-p file))
+ (while (and (not (file-directory-p file)) (file-exists-p file))
(setq file (file-name-directory (directory-file-name file))))
(setq file (abbreviate-file-name file))
(let ((root nil)