- (let (;; FIXME: The old code here used to do
- ;; (MERGE-PATHNAMES PROGRAM "path:"),
- ;; which is the right idea (searching through the Unix
- ;; PATH). Unfortunately, there is no logical pathname
- ;; "path:" defined in sbcl-0.6.10. It would probably be
- ;; reasonable to restore Unix PATH searching in SBCL, e.g.
- ;; with a function FIND-EXECUTABLE-FILE-IN-POSIX-PATH.
- ;; CMU CL did it with a "PATH:" search list, but CMU CL
- ;; search lists are a non-ANSI extension that SBCL
- ;; doesn't support. -- WHN)
- (pfile (unix-namestring program t))
+ (let ((pfile
+ (if search
+ (let ((p (find-executable-in-search-path program)))
+ (and p (unix-namestring p t)))
+ (unix-namestring program t)))