Avoid calling scm_i_string_start_writing if no chars will be mutated
authorMark H Weaver <mhw@netris.org>
Mon, 9 Jan 2012 01:02:09 +0000 (20:02 -0500)
committerMark H Weaver <mhw@netris.org>
Mon, 9 Jan 2012 01:10:11 +0000 (20:10 -0500)
commitb2fb40a90358fcc5264a4a2fe8c7d24d3d7db2a2
tree42cc2cc02b33be878bc10d9e6b1cc6e853904363
parentc60e6ed4b855cb451b45fbba7e19e714d20be466
Avoid calling scm_i_string_start_writing if no chars will be mutated

* libguile/srfi-13.c (scm_string_copy_x, scm_substring_fill_x,
  string_upcase_x, string_downcase_x, string_titlecase_x,
  string_reverse_x, scm_string_xcopy_x): Avoid calling
  `scm_i_string_start_writing' if the range of indices to be modified is
  empty.  This avoids the error that would be raised by
  `scm_i_string_start_writing' if the string is not mutable.
  Thanks to Bruce Korb <bkorb@gnu.org> for reporting this problem
  and suggesting the fix.
libguile/srfi-13.c