Changeset 13024


Ignore:
Timestamp:
11/15/10 15:05:39 (13 years ago)
Author:
Mark Evenson
Message:

Fix loading from pathnames with '+' in directory pathname re #110.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r13017 r13024  
    200200            try {
    201201                s = URLDecoder.decode(url.getPath(), "UTF-8");
     202                // But rencode \SPACE as '+'
     203                s = s.replace(' ', '+');
    202204            } catch (java.io.UnsupportedEncodingException uee) {
    203205                // Can't happen: every Java is supposed to support
  • trunk/abcl/test/lisp/abcl/jar-pathname.lisp

    r12949 r13024  
    4040    (compile-file "bar.lisp")
    4141    (compile-file "eek.lisp")
    42     (let* ((dir (merge-pathnames "tmp/" *abcl-test-directory*))
    43            (sub (merge-pathnames "a/b/" dir)))
    44       (when (probe-directory dir)
    45         (delete-directory-and-files dir))
    46       (ensure-directories-exist sub)
    47       (sys:unzip (merge-pathnames "foo.abcl")
    48                  dir)
    49       (sys:unzip (merge-pathnames "foo.abcl")
    50                  sub)
     42    (let* ((tmpdir (merge-pathnames "tmp/" *abcl-test-directory*))
     43           (subdirs
     44            (mapcar (lambda (p) (merge-pathnames p tmpdir))
     45                    '("a/b/" "d/e+f/")))
     46           (sub1 (first subdirs))
     47           (sub2 (second subdirs)))
     48      (when (probe-directory tmpdir)
     49        (delete-directory-and-files tmpdir))
     50      (mapcar (lambda (p) (ensure-directories-exist p)) subdirs)
     51      (sys:unzip (merge-pathnames "foo.abcl") tmpdir)
     52      (sys:unzip (merge-pathnames "foo.abcl") sub1)
    5153      (cl-fad-copy-file (merge-pathnames "bar.abcl")
    52                  (merge-pathnames "bar.abcl" dir))
     54                        (merge-pathnames "bar.abcl" tmpdir))
    5355      (cl-fad-copy-file (merge-pathnames "bar.abcl")
    54                  (merge-pathnames "bar.abcl" sub))
     56                        (merge-pathnames "bar.abcl" sub1))
     57      (cl-fad-copy-file (merge-pathnames "bar.abcl")
     58                        (merge-pathnames "bar.abcl" sub2))
    5559      (cl-fad-copy-file (merge-pathnames "eek.lisp")
    56                  (merge-pathnames "eek.lisp" dir))
     60                        (merge-pathnames "eek.lisp" tmpdir))
    5761      (cl-fad-copy-file (merge-pathnames "eek.lisp")
    58                  (merge-pathnames "eek.lisp" sub))
     62                        (merge-pathnames "eek.lisp" sub1))
    5963      (sys:zip (merge-pathnames "baz.jar")
    60                (append
    61                 (directory (merge-pathnames "*" dir))
    62                 (directory (merge-pathnames "*" sub)))
    63                dir)
    64       (delete-directory-and-files dir)))
     64               (loop :for p :in (list tmpdir sub1 sub2)
     65                  :appending (directory (merge-pathnames "*" p)))
     66               tmpdir)
     67      #+nil (delete-directory-and-files dir)))
    6568  (setf *jar-file-init* t))
    6669
     
    122125  t)
    123126
     127(deftest jar-pathname.load.11
     128    (with-jar-file-init
     129        (load "jar:file:baz.jar!/d/e+f/bar.abcl"))
     130  t)
     131
    124132;;; wrapped in PROGN for easy disabling without a network connection
    125133;;; XXX come up with a better abstraction
     
    132140
    133141(progn
    134   (deftest jar-pathname.load.11
     142  (deftest jar-pathname.load.http.1
    135143      (load-url-relative "foo")
    136144    t)
    137145
    138   (deftest jar-pathname.load.12
     146  (deftest jar-pathname.load.http.2
    139147      (load-url-relative "bar")
    140148    t)
    141149
    142   (deftest jar-pathname.load.13
     150  (deftest jar-pathname.load.http.3
    143151      (load-url-relative "bar.abcl")
    144152    t)
    145153
    146   (deftest jar-pathname.load.14
     154  (deftest jar-pathname.load.http.4
    147155      (load-url-relative "eek")
    148156    t)
    149157
    150   (deftest jar-pathname.load.15
     158  (deftest jar-pathname.load.http.5
    151159      (load-url-relative "eek.lisp")
    152160    t)
    153161
    154   (deftest jar-pathname.load.16
     162  (deftest jar-pathname.load.http.6
    155163      (load-url-relative "a/b/foo")
    156164    t)
    157165
    158   (deftest jar-pathname.load.17
     166  (deftest jar-pathname.load.http.7
    159167      (load-url-relative "a/b/bar")
    160168    t)
    161169
    162   (deftest jar-pathname.load.18
     170  (deftest jar-pathname.load.http.8
    163171      (load-url-relative "a/b/bar.abcl")
    164172    t)
    165173
    166   (deftest jar-pathname.load.19
     174  (deftest jar-pathname.load.http.9
    167175      (load-url-relative "a/b/eek")
    168176    t)
    169177
    170   (deftest jar-pathname.load.20
     178  (deftest jar-pathname.load.http.10
    171179      (load-url-relative "a/b/eek.lisp")
    172180    t))
     
    193201    (with-jar-file-init
    194202        (probe-file "jar:file:baz.jar!/a/b"))
    195   nil)
     203  #p#.(format nil "jar:file:~Abaz.jar!/a/b/"
     204                       (namestring *abcl-test-directory*)))
    196205
    197206(deftest jar-pathname.probe-file.5
     
    199208        (probe-file "jar:file:baz.jar!/a/b/"))
    200209  #p#.(format nil "jar:file:~Abaz.jar!/a/b/"
     210                       (namestring *abcl-test-directory*)))
     211
     212(deftest jar-pathname.probe-file.6
     213    (with-jar-file-init
     214        (probe-file "jar:file:baz.jar!/d/e+f/bar.abcl"))
     215  #p#.(format nil "jar:file:~Abaz.jar!/d/e+f/bar.abcl"
    201216                       (namestring *abcl-test-directory*)))
    202217
Note: See TracChangeset for help on using the changeset viewer.