From 51dd481ade51b1051b9132977778f0cb31fec63b Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" <rpgoldman@gmail.com> Date: Sun, 30 Nov 2014 22:12:11 -0600 Subject: [PATCH] Simplify PARSE-NATIVE-NAMESTRING Remove early check for absolute pathname, deferring to ENSURE-PATHNAME. --- uiop/filesystem.lisp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/uiop/filesystem.lisp b/uiop/filesystem.lisp index 8ef8296a..959a4e33 100644 --- a/uiop/filesystem.lisp +++ b/uiop/filesystem.lisp @@ -40,22 +40,18 @@ (if (os-unix-p) (unix-namestring p) (namestring p))))) - (defun parse-native-namestring (string &rest constraints &key want-absolute ensure-directory &allow-other-keys) + (defun parse-native-namestring (string &rest constraints &key ensure-directory &allow-other-keys) "From a native namestring suitable for use by the operating system, return a CL pathname satisfying all the specified constraints as per ENSURE-PATHNAME" (check-type string (or string null)) (let* ((pathname - (when string - (unless (or (not want-absolute) - (absolute-pathname-p string)) - (error "Invalid pathname ~S: Expected an absolute pathname." string)) - (with-pathname-defaults () - #+clozure (ccl:native-to-pathname string) - #+sbcl (sb-ext:parse-native-namestring string) - #-(or clozure sbcl) - (if (os-unix-p) - (parse-unix-namestring string :ensure-directory ensure-directory) - (parse-namestring string))))) + (with-pathname-defaults () + #+clozure (ccl:native-to-pathname string) + #+sbcl (sb-ext:parse-native-namestring string) + #-(or clozure sbcl) + (if (os-unix-p) + (parse-unix-namestring string :ensure-directory ensure-directory) + (parse-namestring string)))) (pathname (if ensure-directory (and pathname (ensure-directory-pathname pathname)) -- GitLab