- fix bug: PARSE-URI couldn't handle ? and # in the same URI

- use fixed URI-RESERVED-SANS-= instead of computing
  (char-set-delete uri-reserved #\=)
  each time PARSE-URI is called
This commit is contained in:
sperber 2003-01-15 10:14:06 +00:00
parent ff8061c4ea
commit 8800f37a3b
1 changed files with 6 additions and 4 deletions

View File

@ -16,6 +16,8 @@
(define uri-reserved (string->char-set ";/#?: ="))
(define uri-reserved-sans-= (char-set-delete uri-reserved #\=))
(define (parse-uri s)
(let* ((slen (string-length s))
;; Search forwards for colon (or intervening reserved char).
@ -29,10 +31,10 @@
;; Search backwards for ? (or intervening reserved char).
;; (NB: #\= may be after #\? and before #\#)
(rs-penult (string-index-right
s
(char-set-delete uri-reserved #\=)
(or sharp slen)))
(rs-penult (string-index-right s
uri-reserved-sans-=
path-start
(or sharp slen)))
(ques (and rs-penult (char=? (string-ref s rs-penult) #\?) rs-penult))
(path-end (or ques sharp slen)))