mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
iprin1 uses scm_c_put_string
* libguile/print.c (iprin1): Use scm_c_put_string for strings. * test-suite/test-suite/lib.scm (exception:encoding-error): Add an additional expected error string for `encoding-error'.
This commit is contained in:
parent
8f615cde45
commit
934b6dc398
2 changed files with 3 additions and 6 deletions
|
@ -717,7 +717,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
size_t len, printed;
|
size_t len, printed;
|
||||||
|
|
||||||
len = scm_i_string_length (exp);
|
printed = len = scm_i_string_length (exp);
|
||||||
if (SCM_WRITINGP (pstate))
|
if (SCM_WRITINGP (pstate))
|
||||||
{
|
{
|
||||||
printed = write_string (scm_i_string_data (exp),
|
printed = write_string (scm_i_string_data (exp),
|
||||||
|
@ -727,10 +727,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
len += 2; /* account for the quotes */
|
len += 2; /* account for the quotes */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printed = display_string (scm_i_string_data (exp),
|
scm_c_put_string (port, exp, 0, len);
|
||||||
scm_i_is_narrow_string (exp),
|
|
||||||
len, port,
|
|
||||||
PORT_CONVERSION_HANDLER (port));
|
|
||||||
|
|
||||||
if (SCM_UNLIKELY (printed < len))
|
if (SCM_UNLIKELY (printed < len))
|
||||||
scm_encoding_error (__func__, errno,
|
scm_encoding_error (__func__, errno,
|
||||||
|
|
|
@ -287,7 +287,7 @@
|
||||||
(define exception:system-error
|
(define exception:system-error
|
||||||
(cons 'system-error ".*"))
|
(cons 'system-error ".*"))
|
||||||
(define exception:encoding-error
|
(define exception:encoding-error
|
||||||
(cons 'encoding-error "(cannot convert.* to output locale|input (locale conversion|decoding) error)"))
|
(cons 'encoding-error "(cannot convert.* to output locale|input (locale conversion|decoding) error|conversion to port encoding failed)"))
|
||||||
(define exception:miscellaneous-error
|
(define exception:miscellaneous-error
|
||||||
(cons 'misc-error "^.*"))
|
(cons 'misc-error "^.*"))
|
||||||
(define exception:read-error
|
(define exception:read-error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue