From: Chris Hanson Date: Sat, 23 Mar 1996 06:20:57 +0000 (+0000) Subject: Add error check so that attempting to insert a negative number of X-Git-Tag: 20090517-FFI~5638 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=910815d0fca916f477102390e58b0bd01dbbb600;p=mit-scheme.git Add error check so that attempting to insert a negative number of characters results in a tractable error rather than a SIGSEGV. --- diff --git a/v7/src/edwin/grpops.scm b/v7/src/edwin/grpops.scm index 6ca13f0ff..413b018d7 100644 --- a/v7/src/edwin/grpops.scm +++ b/v7/src/edwin/grpops.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: grpops.scm,v 1.22 1995/04/17 21:46:10 cph Exp $ +;;; $Id: grpops.scm,v 1.23 1996/03/23 06:20:57 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -113,6 +113,8 @@ (group-insert-chars! group index char 1)) (define (group-insert-chars! group index char n) + (if (fix:< n 0) + (error:bad-range-argument n 'GROUP-INSERT-CHARS!)) (let ((interrupt-mask (set-interrupt-enables! interrupt-mask/gc-ok))) (prepare-gap-for-insert! group index n) (let ((text (group-text group))