1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-29 14:30:34 +02:00

Remove null string optimization from scm_from_stringn

* libguile/strings.c (scm_from_stringn): Always return a freshly
  allocated string from scm_from_stringn, even when asked to construct
  the null string, in accordance with the R5RS.  Previously, we
  optimized the null string case by returning a reference to a global
  null string object (scm_nullstr).
This commit is contained in:
Mark H Weaver 2012-01-09 18:24:22 -05:00
parent 0e947e1d14
commit 86c63a8251

View file

@ -1472,8 +1472,6 @@ scm_from_stringn (const char *str, size_t len, const char *encoding,
scm_misc_error ("scm_from_stringn", "NULL string pointer", SCM_EOL);
if (len == (size_t) -1)
len = strlen (str);
if (len == 0)
return scm_nullstr;
if (encoding == NULL)
{