summaryrefslogtreecommitdiff
path: root/libguile/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/strings.c')
-rw-r--r--libguile/strings.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index a5b4b0386..a48f82b4a 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -763,10 +763,14 @@ SCM
scm_i_make_symbol (SCM name, scm_t_bits flags, unsigned long hash)
{
SCM buf, symbol;
- size_t length = STRING_LENGTH (name);
+ size_t start, length = STRING_LENGTH (name);
- name = scm_i_substring_copy (name, 0, length);
- buf = STRING_STRINGBUF (name);
+ get_str_buf_start (&name, &buf, &start);
+ if (SCM_UNLIKELY (STRINGBUF_MUTABLE (buf) || start != 0))
+ {
+ name = scm_i_substring_copy (name, 0, length);
+ buf = STRING_STRINGBUF (name);
+ }
symbol = scm_words (scm_tc7_symbol | flags, 3);
SCM_SET_CELL_WORD_1 (symbol, SCM_UNPACK (buf));