From: Chris Hanson Date: Thu, 4 Oct 2001 16:13:57 +0000 (+0000) Subject: Don't unnecessarily change the length of a string when altering its X-Git-Tag: 20090517-FFI~2528 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a806e90d44c2eeef17ca4429183051496eb03a1a;p=mit-scheme.git Don't unnecessarily change the length of a string when altering its maximum length. --- diff --git a/v7/src/microcode/string.c b/v7/src/microcode/string.c index b7400d7b0..3416ceb15 100644 --- a/v7/src/microcode/string.c +++ b/v7/src/microcode/string.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: string.c,v 9.45 2001/10/04 16:13:24 cph Exp $ +$Id: string.c,v 9.46 2001/10/04 16:13:57 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -161,7 +161,7 @@ DEFINE_PRIMITIVE ("SET-STRING-MAXIMUM-LENGTH!", Prim_set_string_maximum_length, SCHEME_OBJECT string = (ARG_REF (1)); long length = (arg_index_integer (2, ((MAXIMUM_STRING_LENGTH (string)) + 1))); - if (max_length < (STRING_LENGTH (string))) + if (length < (STRING_LENGTH (string))) SET_STRING_LENGTH (string, max_length); MEMORY_SET (string,