From a4a75626d9d1e227b92d41d62e7d2b7f52d4cf4e Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Thu, 26 Jun 1997 23:40:24 +0000 Subject: [PATCH] Fixed a bug in argument checking SUBSTRING. Introduced GUARANTEE-SUBSTRING and edited other procedures to use it. --- v7/src/runtime/string.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/v7/src/runtime/string.scm b/v7/src/runtime/string.scm index 90d64be0d..75612242e 100644 --- a/v7/src/runtime/string.scm +++ b/v7/src/runtime/string.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: string.scm,v 14.13 1997/06/26 22:55:46 adams Exp $ +$Id: string.scm,v 14.14 1997/06/26 23:40:24 adams Exp $ Copyright (c) 1988-1995 Massachusetts Institute of Technology @@ -635,11 +635,11 @@ MIT in each case. |# (define-integrable (guarantee-substring string start end procedure) - (if (or (not (string? string)) - (not (index-fixnum? start)) - (not (index-fixnum? end)) - (not (fix:<= start end)) - (not (fix:<= end (string-length string)))) + (if (not (and (string? string) + (index-fixnum? start) + (index-fixnum? end) + (fix:<= start end) + (fix:<= end (string-length string)))) (guarantee-substring/fail string start end procedure))) (define (guarantee-substring/fail string start end procedure) -- 2.25.1