Changeset 13108 in project


Ignore:
Timestamp:
01/26/09 22:19:24 (11 years ago)
Author:
sjamaan
Message:

Fix annoying edge case with empty path components in merge-paths procedure, add test. Also clean up a COND guard a little by using LET instead of LAMBDA

Location:
release/4/uri-generic/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/tests/run.scm

    r12923 r13108  
    108108    ("http://a/b/c/d/" "../e/" "http://a/b/c/e/")
    109109    ("http://a/b//c///d///" "..//.." "http://a/b/")
     110    ("http://a" "b" "http://a/b") ; RFC3986, section 5.2.3, first bullet point
    110111    ))
    111112
  • release/4/uri-generic/trunk/uri-generic.scm

    r13105 r13108  
    823823                                                path: (just-segments ref)
    824824                                                scheme: (uri-scheme base)))
    825              (((lambda (p) (and (not (null? p)) p))  (uri-path ref)) =>
     825             ((let ((p (uri-path ref))) (and (not (null? p)) p)) =>
    826826              (lambda (ref-path)
    827827                (if (and (pair? ref-path) (eq? '/ (car ref-path)))
     
    855855  (let ((ba (uri-authority b))
    856856        (pb (uri-path b)))
    857     (let ((mp  (if (and ba (null? pb)) pr (merge0 pb pr))))
     857    (let ((mp (if (and ba (null? pb))
     858                  (merge0 '(/ "") pr) ; RFC3986, section 5.2.3, first bullet
     859                  (merge0 pb pr))))
    858860      (remove-dot-segments mp))))
    859861
Note: See TracChangeset for help on using the changeset viewer.