Fix bugs related to mutation-sharing substrings
authorMark H Weaver <mhw@netris.org>
Wed, 4 Jan 2012 22:59:27 +0000 (17:59 -0500)
committerMark H Weaver <mhw@netris.org>
Sat, 7 Jan 2012 15:36:22 +0000 (10:36 -0500)
commit49d09292ac6d92a86b574478a69450b85d2dd8c1
tree610c018369ab10396a0c69dffebd3218e4e357f6
parenta7e392c1fff2921af027675e8655b5892ac1142e
Fix bugs related to mutation-sharing substrings

* libguile/strings.c (scm_i_is_narrow_string, scm_i_try_narrow_string,
  scm_i_string_set_x): Check to see if the provided string is a
  mutation-sharing substring, and do the right thing in that case.
  Previously, if such a string was passed to these functions, they would
  behave very badly: while trying to fetch and/or mutate the cell
  containing the stringbuf, they were actually fetching or mutating the
  cell containing the original shared string.  That's because
  mutation-sharing substrings store the original string in CELL_1,
  whereas all other strings store the stringbuf there.
libguile/strings.c