summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2012-01-06 18:39:04 -0500
committerMark H Weaver <mhw@netris.org>2012-01-07 04:46:46 -0500
commita7e392c1fff2921af027675e8655b5892ac1142e (patch)
tree7ecb120a063a53fc32cbfb0e499ea0f4e90e857d
parent213544e0dccb67339b009fbd7640ff9b48ca33f6 (diff)
downloadguile-a7e392c1fff2921af027675e8655b5892ac1142e.tar.gz
Make scm_nullstr mutable
* libguile/strings.c (scm_init_strings): Make scm_nullstr mutable. It is still usable as a common object, because of course it contains no characters to mutate anyway. It is returned by several procedures that are specified to return mutable strings, and string mutators raise errors when passed an immutable string, even if it is the null string.
-rw-r--r--libguile/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index 666a9516b..870825a77 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,2000,2001, 2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,2000,2001, 2004, 2006, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -2224,7 +2224,7 @@ SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
void
scm_init_strings ()
{
- scm_nullstr = scm_i_make_string (0, NULL, 1);
+ scm_nullstr = scm_i_make_string (0, NULL, 0);
#include "libguile/strings.x"
}