From 27c2d02ac3bf85277021955abc2dabc348a2447b Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Sat, 5 Sep 2009 21:47:20 -0700 Subject: [PATCH] Revert change in re SET-STRING-MAXIMUM-LENGTH --- src/runtime/input.scm | 6 +----- src/runtime/pgsql.scm | 4 +--- src/runtime/stringio.scm | 22 ++++++++-------------- 3 files changed, 10 insertions(+), 22 deletions(-) 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) -- 2.25.1