From 3e9e71e7345ef984f615511864f91271cfb93ba5 Mon Sep 17 00:00:00 2001 From: espen Date: Wed, 15 Feb 2006 23:36:17 +0000 Subject: [PATCH] Fixed warning about invalid directory --- tools/asdf-extensions.lisp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/asdf-extensions.lisp b/tools/asdf-extensions.lisp index 6b3da93..b7a589b 100644 --- a/tools/asdf-extensions.lisp +++ b/tools/asdf-extensions.lisp @@ -106,17 +106,22 @@ ((libdir :initarg :libdir))) -(defun relative-pathname (path) - (etypecase path - (cons path) - (string (if (char= #\/ (char path 0)) - (subseq path 1) - path)))) +(defun split-path (path) + (labels ((split (path) + (unless (zerop (length path)) + (let ((slash (position #\/ path))) + (if slash + (cons (subseq path 0 slash) (split (subseq path (1+ slash)))) + (list path)))))) + (if (and (not (zerop (length path))) (char= (char path 0) #\/)) + (cons :absolute (split (subseq path 1))) + (cons :relative (split path))))) + (defmethod component-pathname ((lib library)) (make-pathname :type "so" :name (component-name lib) - :directory (relative-pathname (slot-value lib 'libdir)))) + :directory (split-path (slot-value lib 'libdir)))) (defmethod perform ((o load-op) (c library)) (load-dso (component-pathname c))) -- 2.11.0