From 44cd688b7bd379472f900fa1571ed17fd649730e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 11 Oct 2007 11:22:19 +0000 Subject: [PATCH] Robustify a bit against filenames with no directory component. --- lisp/ChangeLog | 5 +++++ lisp/vc-hooks.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1eeb9820beb..63f8b7a2a65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-11 Eric S. Raymond + + * vc-hooks.el (vc-registered): Robustify this function a bit + against filenames with no directory component. + 2007-10-11 Stefan Monnier * international/characters.el: Undo unwanted and unexplained change. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index d2825f9b5bb..64ce29ddaf4 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -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 -- 2.39.5