Unoptimize 'read' to return freshly allocated empty strings
authorMark H Weaver <mhw@netris.org>
Wed, 8 Feb 2012 20:32:55 +0000 (15:32 -0500)
committerMark H Weaver <mhw@netris.org>
Wed, 8 Feb 2012 21:27:32 +0000 (16:27 -0500)
commit043850d984c184a1e642a60a38723e63bf3be73a
tree07c797b320b3d481966aa74714d8ad92de6f7581
parentd5b75b6c803e746e6ec019951716bf4ff2ebc84b
Unoptimize 'read' to return freshly allocated empty strings

* libguile/read.c (scm_read_string): Return a freshly allocated string
  every time, even for empty strings.  The motivation is to allow source
  properties to be added to all strings.  Previously, the shared global
  'scm_nullstr' was returned for empty strings.  Note that empty strings
  still share a common global 'null_stringbuf'.

* test-suite/tests/srfi-13.test (substring/shared): Fix tests to reflect
  the fact that empty string literals are no longer guaranteed to be
  'eq?' to each other.
libguile/read.c
test-suite/tests/srfi-13.test