changeset 87337:bad7c1eb5392

(vc-ensure-vc-buffer): Avoid infinite looping when vc-parent-buffer is the current buffer.
author Martin Rudalics <rudalics@gmx.at>
date Wed, 19 Dec 2007 09:25:18 +0000
parents 9088a29785d1
children c1a567b9ea73
files lisp/vc.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc.el	Wed Dec 19 09:24:31 2007 +0000
+++ b/lisp/vc.el	Wed Dec 19 09:25:18 2007 +0000
@@ -1297,7 +1297,10 @@
   "Make sure that the current buffer visits a version-controlled file."
   (if vc-dired-mode
       (set-buffer (find-file-noselect (dired-get-filename)))
-    (while vc-parent-buffer
+    (while (and vc-parent-buffer
+		;; Avoid infinite looping when vc-parent-buffer and
+		;; current buffer are the same buffer.
+ 		(not (eq vc-parent-buffer (current-buffer))))
       (set-buffer vc-parent-buffer))
     (if (not buffer-file-name)
 	(error "Buffer %s is not associated with a file" (buffer-name))