From: Chris Hanson Date: Thu, 12 Jan 2017 09:37:19 +0000 (-0800) Subject: Eliminate use of read-substring! in favor of read-string!. X-Git-Tag: mit-scheme-pucked-9.2.12~227^2~139 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4aabe0d2bd366a0692c38fe388fde2bf6fb842cd;p=mit-scheme.git Eliminate use of read-substring! in favor of read-string!. --- diff --git a/src/blowfish/blowfish.scm b/src/blowfish/blowfish.scm index a7df5d1bb..d10fd834c 100644 --- a/src/blowfish/blowfish.scm +++ b/src/blowfish/blowfish.scm @@ -220,7 +220,7 @@ USA. (make-string 8 #\NUL)) ((string=? blowfish-file-header-v2 line) (let ((init-vector (make-string 8))) - (if (not (= 8 (read-substring! init-vector 0 8 port))) + (if (not (= 8 (read-string! init-vector port))) (error "Short read while getting init-vector:" port)) init-vector)) (else diff --git a/src/imail/imail-util.scm b/src/imail/imail-util.scm index ca9ba4f42..be1d565ae 100644 --- a/src/imail/imail-util.scm +++ b/src/imail/imail-util.scm @@ -429,7 +429,7 @@ USA. (let ((xstring (make-string n-bytes))) (let loop ((start 0)) (if (< start n-bytes) - (let ((n-read (read-substring! xstring 0 n-bytes port))) + (let ((n-read (read-string! xstring port))) (if (= n-read 0) (error "Failed to read complete file:" (+ start n-read) n-bytes pathname)) diff --git a/src/imail/imap-response.scm b/src/imail/imap-response.scm index 9726fa1ce..fdf79964c 100644 --- a/src/imail/imap-response.scm +++ b/src/imail/imap-response.scm @@ -550,7 +550,7 @@ USA. s)) (define (read-substring!-internal string start end port) - (let ((n-read (read-substring! string start end port))) + (let ((n-read (read-string! string port start end))) (if imap-transcript-port (write-substring string start (+ start n-read) imap-transcript-port)) n-read)) diff --git a/src/md5/md5.scm b/src/md5/md5.scm index 8bdc1a7d8..0649f0555 100644 --- a/src/md5/md5.scm +++ b/src/md5/md5.scm @@ -76,7 +76,7 @@ USA. unspecific) (lambda () (let loop () - (let ((n (read-substring! buffer 0 4096 port))) + (let ((n (read-string! buffer port))) (if (fix:= 0 n) (%md5-final context) (begin diff --git a/src/mhash/mhash.scm b/src/mhash/mhash.scm index e0368f823..4ed16fe72 100644 --- a/src/mhash/mhash.scm +++ b/src/mhash/mhash.scm @@ -401,7 +401,7 @@ USA. unspecific) (lambda () (let loop () - (let ((n (read-substring! buffer 0 4096 port))) + (let ((n (read-string! buffer port))) (if (fix:= 0 n) (mhash-end context) (begin diff --git a/src/runtime/blowfish.scm b/src/runtime/blowfish.scm index 8515624bc..e2996c7ae 100644 --- a/src/runtime/blowfish.scm +++ b/src/runtime/blowfish.scm @@ -88,7 +88,7 @@ USA. (make-string 8 #\NUL)) ((string=? blowfish-file-header-v2 line) (let ((init-vector (make-string 8))) - (if (not (= 8 (read-substring! init-vector 0 8 port))) + (if (not (= 8 (read-string! init-vector port))) (error "Short read while getting init-vector:" port)) init-vector)) (else diff --git a/src/runtime/crypto.scm b/src/runtime/crypto.scm index 0cd41a54e..10d8eeaa0 100644 --- a/src/runtime/crypto.scm +++ b/src/runtime/crypto.scm @@ -248,7 +248,7 @@ USA. unspecific) (lambda () (let loop () - (let ((n (read-substring! buffer 0 4096 port))) + (let ((n (read-string! buffer port))) (if (fix:= 0 n) (mhash-end context) (begin @@ -312,7 +312,7 @@ USA. unspecific) (lambda () (let loop () - (let ((n (read-substring! buffer 0 4096 port))) + (let ((n (read-string! buffer port))) (if (fix:= 0 n) ((ucode-primitive md5-final 1) context) (begin diff --git a/src/runtime/httpio.scm b/src/runtime/httpio.scm index 46b186d1a..212b4443f 100644 --- a/src/runtime/httpio.scm +++ b/src/runtime/httpio.scm @@ -286,7 +286,7 @@ USA. (let ((len (vector-8b-length buffer))) (let loop ((n n)) (if (> n 0) - (let ((m (read-substring! buffer 0 (min n len) port))) + (let ((m (read-string! buffer port 0 (min n len)))) (if (= m 0) (error "Premature EOF in HTTP message body.")) (write-substring buffer 0 m output) diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index 175e19525..5ef162f77 100644 --- a/src/runtime/swank.scm +++ b/src/runtime/swank.scm @@ -154,7 +154,7 @@ USA. (buffer (make-string end))) (let loop ((start 0)) (if (< start end) - (loop (+ start (read-substring! buffer start end in))) + (loop (+ start (read-string! buffer in start end))) buffer)))) (define (decode-message socket packet) diff --git a/src/ssp/mod-lisp.scm b/src/ssp/mod-lisp.scm index ad5c9479a..686c56ecf 100644 --- a/src/ssp/mod-lisp.scm +++ b/src/ssp/mod-lisp.scm @@ -214,7 +214,7 @@ USA. (let ((end (string-length entity))) (let loop ((start 0)) (if (fix:< start end) - (let ((n-read (read-substring! entity start end port))) + (let ((n-read (read-string! entity port start end))) (cond ((not n-read) (loop start)) ((> n-read 0)