* removed introduced bug in ESCAPE-URI, happened by removing stringhax.scm
(string-reduce was not fold-right but fold-left)
This commit is contained in:
parent
09dfa74792
commit
87e3cb0c84
4
ftpd.scm
4
ftpd.scm
|
@ -16,7 +16,7 @@
|
||||||
; - GET/RETR-command: ftpd reports "Can't open FILENAME for reading" if
|
; - GET/RETR-command: ftpd reports "Can't open FILENAME for reading" if
|
||||||
; file actually doesn't exist. This is confusing. Reporting
|
; file actually doesn't exist. This is confusing. Reporting
|
||||||
; "FILENAME does not exist" is much better.
|
; "FILENAME does not exist" is much better.
|
||||||
|
; - default value for ftpd should be looked up as in ftp.scm
|
||||||
|
|
||||||
(define *logfile* #f) ; file-port to log to like wu-ftpd (analyzable with webalizer)
|
(define *logfile* #f) ; file-port to log to like wu-ftpd (analyzable with webalizer)
|
||||||
|
|
||||||
|
@ -1218,7 +1218,7 @@
|
||||||
|
|
||||||
; Version
|
; Version
|
||||||
|
|
||||||
(define *ftpd-version* "$Revision: 1.37 $")
|
(define *ftpd-version* "$Revision: 1.38 $")
|
||||||
|
|
||||||
(define (copy-port->port-binary input-port output-port)
|
(define (copy-port->port-binary input-port output-port)
|
||||||
(let ((buffer (make-string *window-size*)))
|
(let ((buffer (make-string *window-size*)))
|
||||||
|
|
20
htmlout.scm
20
htmlout.scm
|
@ -163,19 +163,19 @@
|
||||||
|
|
||||||
(define (escape-html s)
|
(define (escape-html s)
|
||||||
(let ((target-length
|
(let ((target-length
|
||||||
(string-fold-right (lambda (c i)
|
(string-fold (lambda (c i)
|
||||||
(+ i
|
(+ i
|
||||||
(if (char-set-contains? *html-entities* c)
|
(if (char-set-contains? *html-entities* c)
|
||||||
(string-length
|
(string-length
|
||||||
(vector-ref *html-entity-table*
|
(vector-ref *html-entity-table*
|
||||||
(char->ascii c)))
|
(char->ascii c)))
|
||||||
1)))
|
1)))
|
||||||
0
|
0
|
||||||
s)))
|
s)))
|
||||||
(if (= target-length (string-length s))
|
(if (= target-length (string-length s))
|
||||||
s
|
s
|
||||||
(let ((target (make-string target-length)))
|
(let ((target (make-string target-length)))
|
||||||
(string-fold-right
|
(string-fold
|
||||||
(lambda (c i)
|
(lambda (c i)
|
||||||
(+ i
|
(+ i
|
||||||
(if (char-set-contains? *html-entities* c)
|
(if (char-set-contains? *html-entities* c)
|
||||||
|
|
4
uri.scm
4
uri.scm
|
@ -161,7 +161,7 @@
|
||||||
|
|
||||||
(define (escape-uri s . maybe-escaped-chars)
|
(define (escape-uri s . maybe-escaped-chars)
|
||||||
(let-optionals maybe-escaped-chars ((escaped-chars uri-escaped-chars))
|
(let-optionals maybe-escaped-chars ((escaped-chars uri-escaped-chars))
|
||||||
(let ((nlen (string-fold-right
|
(let ((nlen (string-fold
|
||||||
(lambda (c i)
|
(lambda (c i)
|
||||||
(+ i
|
(+ i
|
||||||
(if (char-set-contains? escaped-chars c)
|
(if (char-set-contains? escaped-chars c)
|
||||||
|
@ -170,7 +170,7 @@
|
||||||
s))) ; new length of escaped string
|
s))) ; new length of escaped string
|
||||||
(if (= nlen (string-length s)) s
|
(if (= nlen (string-length s)) s
|
||||||
(let ((ns (make-string nlen)))
|
(let ((ns (make-string nlen)))
|
||||||
(string-fold-left
|
(string-fold
|
||||||
(lambda (c i) ; replace each occurance of an
|
(lambda (c i) ; replace each occurance of an
|
||||||
; character to escape with %ff where ff
|
; character to escape with %ff where ff
|
||||||
; is the ascii-code in hexadecimal
|
; is the ascii-code in hexadecimal
|
||||||
|
|
Loading…
Reference in New Issue