From: Paul Eggert Date: Mon, 27 Sep 1993 04:36:31 +0000 (+0000) Subject: (vc-find-binary): Fix bug; it always claimed success. X-Git-Tag: emacs-19.34~11060 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=deb9ebc6cb61c5f9e99da38810e16b911cd3917e;p=emacs.git (vc-find-binary): Fix bug; it always claimed success. --- diff --git a/lisp/vc.el b/lisp/vc.el index 7795850016c..060d64794eb 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -164,16 +164,19 @@ is sensitive to blank lines.") (defun vc-find-binary (name) "Look for a command anywhere on the subprocess-command search path." (or (cdr (assoc name vc-binary-assoc)) - (let ((full nil)) - (catch 'found - (mapcar - (function (lambda (s) - (if (and s (file-exists-p (setq full (concat s "/" name)))) - (throw 'found nil)))) - exec-path)) - (if full - (setq vc-binary-assoc (cons (cons name full) vc-binary-assoc))) - full))) + (catch 'found + (mapcar + (function + (lambda (s) + (if s + (let ((full (concat s "/" name))) + (if (file-executable-p full) + (progn + (setq vc-binary-assoc + (cons (cons name full) vc-binary-assoc)) + (throw 'found full))))))) + exec-path) + nil))) (defun vc-do-command (okstatus command file &rest flags) "Execute a version-control command, notifying user and checking for errors.