diff options
-rw-r--r-- | src/ChangeLog | 10 | ||||
-rw-r--r-- | src/interp/lisplib.boot | 4 | ||||
-rw-r--r-- | src/interp/nlib.lisp | 16 | ||||
-rw-r--r-- | src/interp/pathname.boot | 3 | ||||
-rw-r--r-- | src/interp/sys-utility.boot | 7 |
5 files changed, 26 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7ca972b0..04c810d3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-02-06 Gabriel Dos Reis <gdr@cs.tamu.edu> + Alfredo Portes <doyenatccny@gmail.com> + + Fix AW/236, AW/282 + * interp/sys-utility.boot (probeReadableFile): New. + * interp/nlib.lisp (probe-name): Remove. + (make-input-filename): Tidy. + * interp/lisplib.boot (readLib1): Return nil if path inexistent. + (getFileProperty): Likewise. + 2009-02-04 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/domain.lisp: Remove. diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index 9fd15b53..d06478fe 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -49,7 +49,7 @@ readLib(fn,ft) == readLib1(fn,ft,"*") readLib1(fn,ft,fm) == -- see if it exists first - p := pathname [fn,ft,fm] + p := pathname [fn,ft,fm] or return nil readLibPathFast p readLibPathFast p == @@ -94,7 +94,7 @@ getLisplibNoCache(name,id) == getFileProperty(fn,ft,id,cache) == fn in '(DOMAIN SUBDOM MODE) => nil - p := pathname [fn,ft,'"*"] + p := pathname [fn,ft,'"*"] or return nil cache => hasFileProperty(p,id,fn) hasFilePropertyNoCache(p,id,fn) diff --git a/src/interp/nlib.lisp b/src/interp/nlib.lisp index 6664e9f9..434970e6 100644 --- a/src/interp/nlib.lisp +++ b/src/interp/nlib.lisp @@ -1,6 +1,6 @@ ;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007-2008, Gabriel Dos Reis. +;; Copyright (C) 2007-2009, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -304,9 +304,6 @@ (defun make-full-namestring (filearg &optional (filetype nil)) (namestring (merge-pathnames (make-filename filearg filetype)))) -(defun probe-name (file) - (if (probe-file file) (namestring file) nil)) - (defun get-directory-list (ft) (let ((cd (get-current-directory))) (cond ((member ft '("NRLIB" "DAASE" "EXPOSED") :test #'string=) @@ -327,12 +324,11 @@ (dirs (get-directory-list ft)) (newfn nil)) (if (or (null dirname) (eqcar dirname :relative)) - (dolist (dir dirs (probe-name filename)) - (when - (probe-file - (setq newfn (concatenate 'string dir filename))) - (return newfn))) - (probe-name filename)))) + (dolist (dir dirs (|probeReadableFile| filename)) + (setq newfn (concatenate 'string dir filename)) + (when (|probeReadableFile| newfn) + (return newfn))) + (|probeReadableFile| filename)))) (defun $FILEP (&rest filearg) (make-full-namestring filearg)) (define-function '$OUTFILEP #'$FILEP) ;;temporary bogus def diff --git a/src/interp/pathname.boot b/src/interp/pathname.boot index 9c466a07..5df49e60 100644 --- a/src/interp/pathname.boot +++ b/src/interp/pathname.boot @@ -48,8 +48,7 @@ pathname? p == null p or PATHNAMEP p pathname p == - null p => p - PATHNAMEP p => p + pathname? p => p not PAIRP p => PATHNAME p if #p>2 then p:=[p.0,p.1] PATHNAME APPLY(FUNCTION MAKE_-FILENAME, p) diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot index aee7a0be..2d334946 100644 --- a/src/interp/sys-utility.boot +++ b/src/interp/sys-utility.boot @@ -37,6 +37,9 @@ import sys_-os import vmlisp namespace BOOT +module sys_-utility where + probleReadableFile : %String -> %Maybe %String + --% $COMBLOCKLIST := nil @@ -190,6 +193,10 @@ existingFile? file == PROBE_-FILE file => true false +probeReadableFile file == + readablep file > 0 => file + nil + ++ original version returned 0 on success, and 1 on failure ++ ??? fix that to return -1 on failure. $ERASE(:filearg) == |