diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-09-09 22:32:02 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-09-09 22:39:49 +0200 |
commit | 6dc797eee9041498eec7053d32d8721c3660fb51 (patch) | |
tree | 27da6956712e6391c2209045e3ed69e027b63656 /libguile/strings.c | |
parent | d66b74dce74c2824726746e82a8a413463cb80fd (diff) | |
parent | e354d7689aca1f6482bd90a2c367617222052265 (diff) | |
download | guile-6dc797eee9041498eec7053d32d8721c3660fb51.tar.gz |
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
libguile/gc_os_dep.c
Diffstat (limited to 'libguile/strings.c')
-rw-r--r-- | libguile/strings.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c index 519998167..c7f09db21 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -1374,7 +1374,7 @@ scm_is_string (SCM obj) return IS_STRING (obj); } -static SCM +SCM scm_from_stringn (const char *str, size_t len, const char *encoding, scm_t_string_failed_conversion_handler handler) { @@ -1383,6 +1383,9 @@ scm_from_stringn (const char *str, size_t len, const char *encoding, int wide = 0; SCM res; + if (len == 0) + return scm_nullstr; + if (encoding == NULL) { /* If encoding is null, use Latin-1. */ @@ -1570,7 +1573,7 @@ unistring_escapes_to_guile_escapes (char **bufp, size_t *lenp) } char * -scm_to_locale_stringn (SCM str, size_t * lenp) +scm_to_locale_stringn (SCM str, size_t *lenp) { SCM outport; scm_t_port *pt; @@ -1677,6 +1680,8 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding, scm_list_2 (scm_from_locale_string (enc), str)); } + if (handler == SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE) + unistring_escapes_to_guile_escapes (&buf, &len); } if (lenp) *lenp = len; |