Robustify a bit against filenames with no directory component.
authorEric S. Raymond <esr@snark.thyrsus.com>
Thu, 11 Oct 2007 11:22:19 +0000 (11:22 +0000)
committerEric S. Raymond <esr@snark.thyrsus.com>
Thu, 11 Oct 2007 11:22:19 +0000 (11:22 +0000)
lisp/ChangeLog
lisp/vc-hooks.el

index 1eeb982..63f8b7a 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-11  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * vc-hooks.el (vc-registered): Robustify this function a bit
+       against filenames with no directory component.
+
 2007-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * international/characters.el: Undo unwanted and unexplained change.
index d2825f9..64ce29d 100644 (file)
@@ -362,7 +362,8 @@ file was previously registered under a certain backend, then that
 backend is tried first."
   (let (handler)
     (cond
-     ((string-match vc-ignore-dir-regexp (file-name-directory file)) nil)
+     ((and (file-name-directory file) (string-match vc-ignore-dir-regexp (file-name-directory file)))
+      nil)
      ((and (boundp 'file-name-handler-alist)
           (setq handler (find-file-name-handler file 'vc-registered)))
       ;; handler should set vc-backend and return t if registered