From 5f3c53746f3132a66f14d8d2f52cf52170500130 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 18 Oct 2005 14:58:11 +0000 Subject: [PATCH] Let (%)read-delimited! ensure that the buffer is mutable. --- scsh/rdelim.scm | 3 ++- scsh/scsh-package.scm | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scsh/rdelim.scm b/scsh/rdelim.scm index d7ae751..aea1cae 100644 --- a/scsh/rdelim.scm +++ b/scsh/rdelim.scm @@ -191,7 +191,8 @@ (let-optionals args ((port (current-input-port)) (start 0) (end (string-length buf))) - + (if (immutable? buf) + (error "Immutable buffer argument to %read-delimited!" buf)) (let ((delims (x->char-set delims))) (let lp ((start start) (total 0)) (receive (terminator num-read) diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index 33c080b..4d2da99 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -54,6 +54,7 @@ (define-structure delimited-readers delimited-readers-interface (open scheme byte-vectors + (subset primitives (immutable?)) signals ; ERROR let-opt receiving