mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
errno saving in display_string
* libguile/print.c (display_string): Fix a case in which perhaps `errno' could have been stompled.
This commit is contained in:
parent
a964aa62c2
commit
b2548e2344
1 changed files with 3 additions and 1 deletions
|
@ -862,6 +862,8 @@ display_string (const void *str, int narrow_p,
|
||||||
|
|
||||||
if (SCM_UNLIKELY (done == (size_t) -1))
|
if (SCM_UNLIKELY (done == (size_t) -1))
|
||||||
{
|
{
|
||||||
|
int errno_save = errno;
|
||||||
|
|
||||||
/* Reset the `iconv' state. */
|
/* Reset the `iconv' state. */
|
||||||
iconv (pt->output_cd, NULL, NULL, NULL, NULL);
|
iconv (pt->output_cd, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
@ -873,7 +875,7 @@ display_string (const void *str, int narrow_p,
|
||||||
codepoints_read = offsets[input - utf8_buf] - printed;
|
codepoints_read = offsets[input - utf8_buf] - printed;
|
||||||
printed += codepoints_read;
|
printed += codepoints_read;
|
||||||
|
|
||||||
if (errno == EILSEQ &&
|
if (errno_save == EILSEQ &&
|
||||||
strategy != SCM_FAILED_CONVERSION_ERROR)
|
strategy != SCM_FAILED_CONVERSION_ERROR)
|
||||||
{
|
{
|
||||||
/* Conversion failed somewhere in INPUT and we want to
|
/* Conversion failed somewhere in INPUT and we want to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue