From: Eric S. Raymond Date: Thu, 11 Oct 2007 11:22:19 +0000 (+0000) Subject: Robustify a bit against filenames with no directory component. X-Git-Tag: emacs-pretest-23.0.90~10428 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44cd688b7bd379472f900fa1571ed17fd649730e;p=emacs.git Robustify a bit against filenames with no directory component. --- 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