From: Joe Marshall Date: Sun, 6 Sep 2009 04:47:20 +0000 (-0700) Subject: Revert change in re SET-STRING-MAXIMUM-LENGTH X-Git-Tag: 20100708-Gtk~342 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=27c2d02ac3bf85277021955abc2dabc348a2447b;p=mit-scheme.git Revert change in re SET-STRING-MAXIMUM-LENGTH --- diff --git a/src/runtime/input.scm b/src/runtime/input.scm index cee7108d6..18bb21669 100644 --- a/src/runtime/input.scm +++ b/src/runtime/input.scm @@ -103,11 +103,7 @@ USA. (define-integrable (accum->string a) (set-string-maximum-length! (car a) (cdr a)) - ;; jrm's port cannot resize strings, so if the - ;; resize didn't work, just take the substring. - (if (fix:= (string-maximum-length (car a)) (cdr a)) - (car a) - (substring (car a) 0 (cdr a)))) + (car a)) (define-integrable (accum-count a) (cdr a)) diff --git a/src/runtime/pgsql.scm b/src/runtime/pgsql.scm index 03b72625a..2840b162a 100644 --- a/src/runtime/pgsql.scm +++ b/src/runtime/pgsql.scm @@ -301,9 +301,7 @@ USA. (let* ((escaped (make-string (fix:* 2 (string-length string)))) (length (pq-escape-string string escaped))) (set-string-maximum-length! escaped length) - (if (fix:= (string-maximum-length escaped) length) - escaped - (substring escaped 0 length)))) + escaped)) (define (encode-pgsql-bytea bytes) (guarantee-pgsql-available) diff --git a/src/runtime/stringio.scm b/src/runtime/stringio.scm index 3c821c8a7..a43de3381 100644 --- a/src/runtime/stringio.scm +++ b/src/runtime/stringio.scm @@ -423,13 +423,10 @@ USA. (define (narrow-out/extract-output! port) (let* ((os (port/state port)) - (string (ostate-buffer os)) - (length (ostate-index os))) - (set-string-maximum-length! string length) + (string (ostate-buffer os))) + (set-string-maximum-length! string (ostate-index os)) (reset-buffer! os) - (if (fix:= (string-maximum-length string) length) - string - (substring string 0 length)))) + string)) (define (make-wide-output-type) (make-string-out-type wide-out/write-char @@ -607,14 +604,11 @@ USA. (define (octets-out/extract-output! port) (output-port/flush-output port) (let* ((os (output-octets-port/os port)) - (octets (ostate-buffer os)) - (length (ostate-index os))) - (set-string-maximum-length! octets length) - (set-ostate-buffer! os (make-vector-8b 16)) - (set-ostate-index! os 0) - (if (fix:= (string-maximum-length octets) length) - octets - (substring octets 0 length)))) + (octets (ostate-buffer os))) + (set-string-maximum-length! octets (ostate-index os)) + (set-ostate-buffer! os (make-vector-8b 16)) + (set-ostate-index! os 0) + octets)) (define (octets-out/position port) (output-port/flush-output port)