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

Attempt to narrow normalized strings.

* libguile/strings.c (normalize_str): Clean up indentation.  Add call to
  scm_i_try_narrow_string.
This commit is contained in:
Julian Graham 2010-01-06 23:01:05 -05:00
parent 9c246c0383
commit d8164b046c

View file

@ -1760,12 +1760,17 @@ normalize_str (SCM string, uninorm_t form)
w_str[i] = (unsigned char) buf[i]; w_str[i] = (unsigned char) buf[i];
w_str[len] = 0; w_str[len] = 0;
} }
else w_str = (scm_t_uint32 *) scm_i_string_wide_chars (string); else
w_str = (scm_t_uint32 *) scm_i_string_wide_chars (string);
w_str = u32_normalize (form, w_str, len, NULL, &rlen); w_str = u32_normalize (form, w_str, len, NULL, &rlen);
ret = scm_i_make_wide_string (rlen, &cbuf); ret = scm_i_make_wide_string (rlen, &cbuf);
u32_cpy ((scm_t_uint32 *) cbuf, w_str, rlen); u32_cpy ((scm_t_uint32 *) cbuf, w_str, rlen);
free (w_str); free (w_str);
scm_i_try_narrow_string (ret);
return ret; return ret;
} }