Fix use of buffer-file-truename in vc-find-file-hook (tiny change).
authorYuya Nishihara <yuya@tcha.org>
Sat, 1 Dec 2012 13:25:13 +0000 (21:25 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 1 Dec 2012 13:25:13 +0000 (21:25 +0800)
* lisp/vc/vc-hooks.el (vc-find-file-hook): Expand buffer-file-truename
before using it for comparison.

Fixes: debbugs:5297

lisp/ChangeLog
lisp/vc/vc-hooks.el

index c2e5e9f..ec77915 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-01  Yuya Nishihara  <yuya@tcha.org>  (tiny change)
+
+       * vc/vc-hooks.el (vc-find-file-hook): Expand buffer-file-truename
+       before using it for comparison (Bug#5297).
+
 2012-12-01  Jari Aalto  <jari.aalto@cante.net>
 
        * textmodes/css-mode.el (css-current-defun-name): New function.
index ef900cb..40a1f3d 100644 (file)
@@ -858,8 +858,9 @@ current, and kill the buffer that visits the link."
          (set (make-local-variable 'backup-inhibited) t))
        ;; Let the backend setup any buffer-local things he needs.
        (vc-call-backend backend 'find-file-hook))
-       ((let ((link-type (and (not (equal buffer-file-name buffer-file-truename))
-                             (vc-backend buffer-file-truename))))
+       ((let* ((truename (expand-file-name buffer-file-truename))
+              (link-type (and (not (equal buffer-file-name truename))
+                              (vc-backend truename))))
          (cond ((not link-type) nil)   ;Nothing to do.
                ((eq vc-follow-symlinks nil)
                 (message