From 87e3cb0c84789711e0807f7bb1336425a31783c6 Mon Sep 17 00:00:00 2001 From: interp Date: Fri, 26 Apr 2002 10:55:28 +0000 Subject: [PATCH] * removed introduced bug in ESCAPE-URI, happened by removing stringhax.scm (string-reduce was not fold-right but fold-left) --- ftpd.scm | 4 ++-- htmlout.scm | 20 ++++++++++---------- uri.scm | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ftpd.scm b/ftpd.scm index 48a9b15..c10edde 100644 --- a/ftpd.scm +++ b/ftpd.scm @@ -16,7 +16,7 @@ ; - GET/RETR-command: ftpd reports "Can't open FILENAME for reading" if ; file actually doesn't exist. This is confusing. Reporting ; "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) @@ -1218,7 +1218,7 @@ ; Version -(define *ftpd-version* "$Revision: 1.37 $") +(define *ftpd-version* "$Revision: 1.38 $") (define (copy-port->port-binary input-port output-port) (let ((buffer (make-string *window-size*))) diff --git a/htmlout.scm b/htmlout.scm index f20b5bb..d409068 100644 --- a/htmlout.scm +++ b/htmlout.scm @@ -163,19 +163,19 @@ (define (escape-html s) (let ((target-length - (string-fold-right (lambda (c i) - (+ i - (if (char-set-contains? *html-entities* c) - (string-length - (vector-ref *html-entity-table* - (char->ascii c))) - 1))) - 0 - s))) + (string-fold (lambda (c i) + (+ i + (if (char-set-contains? *html-entities* c) + (string-length + (vector-ref *html-entity-table* + (char->ascii c))) + 1))) + 0 + s))) (if (= target-length (string-length s)) s (let ((target (make-string target-length))) - (string-fold-right + (string-fold (lambda (c i) (+ i (if (char-set-contains? *html-entities* c) diff --git a/uri.scm b/uri.scm index 6f506ce..65c673c 100644 --- a/uri.scm +++ b/uri.scm @@ -161,7 +161,7 @@ (define (escape-uri s . maybe-escaped-chars) (let-optionals maybe-escaped-chars ((escaped-chars uri-escaped-chars)) - (let ((nlen (string-fold-right + (let ((nlen (string-fold (lambda (c i) (+ i (if (char-set-contains? escaped-chars c) @@ -170,7 +170,7 @@ s))) ; new length of escaped string (if (= nlen (string-length s)) s (let ((ns (make-string nlen))) - (string-fold-left + (string-fold (lambda (c i) ; replace each occurance of an ; character to escape with %ff where ff ; is the ascii-code in hexadecimal