From 86c63a8251496f1272902185f4b9a0ddcc023815 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 9 Jan 2012 18:24:22 -0500 Subject: [PATCH] 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). --- libguile/strings.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libguile/strings.c b/libguile/strings.c index 6e1f9c80b..73c0a5ce0 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -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) {