From: Chris Hanson Date: Fri, 4 May 2012 08:01:55 +0000 (-0700) Subject: Fix thinko: call-with-input-octets doesn't handle sub-range arguments. X-Git-Tag: release-9.2.0~247^2~19 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=468eecd1984aeea57208a8659c158169917e1721;p=mit-scheme.git Fix thinko: call-with-input-octets doesn't handle sub-range arguments. --- diff --git a/src/runtime/html-form-codec.scm b/src/runtime/html-form-codec.scm index dd4a52f62..c7f8dc06f 100644 --- a/src/runtime/html-form-codec.scm +++ b/src/runtime/html-form-codec.scm @@ -34,20 +34,19 @@ USA. ;;;; Decoder (define (decode-www-form-urlencoded octets start end) - (call-with-input-octets octets start end - (lambda (input) - (port/set-coding input 'us-ascii) - (port/set-line-ending input 'crlf) - (let loop ((data '())) - (let ((char (read-char input))) - (if (eof-object? char) - (reverse! data) - (begin - (unread-char char input) - (let ((name (decode-segment input #t))) - (loop - (cons (cons name (decode-segment input #f)) - data)))))))))) + (let ((input (open-input-octets octets start end))) + (port/set-coding input 'us-ascii) + (port/set-line-ending input 'crlf) + (let loop ((data '())) + (let ((char (read-char input))) + (if (eof-object? char) + (reverse! data) + (begin + (unread-char char input) + (let ((name (decode-segment input #t))) + (loop + (cons (cons name (decode-segment input #f)) + data))))))))) (define (decode-segment input name?) (call-with-output-string