[cxml-devel] [PATCH] Make pathname-to-uri handle :back/:up components in directory.

Pierre R. Mai pmai at pmsf.de
Thu Jun 5 12:14:50 UTC 2008


Previously cxml:parse-file would cause an error in pathname-to-uri  
when handed a pathname with :back or :up entries in the directory  
component.  This change ensures that a suitable base-uri is generated  
in those cases.
---
xml/xml-parse.lisp |    4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp
index eb8e338..546b60b 100644
--- a/xml/xml-parse.lisp
+++ b/xml/xml-parse.lisp
@@ -3030,7 +3030,9 @@
#-cxml-system::uri-is-namestring
(defun pathname-to-uri (pathname)
   (let ((path
-         (append (pathname-directory pathname)
+         (append (mapcar #'(lambda (x) (cond ((member x '(:up :back))  
"..")
+					     (t x)))
+			 (pathname-directory pathname))
                  (list
                   (if (specific-or (pathname-type pathname))
                       (concatenate 'string
-- 
1.5.6.rc1.15.g03aab




More information about the cxml-devel mailing list