summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-02-24 13:10:16 +0100
committerAndy Wingo <wingo@pobox.com>2011-02-24 13:10:16 +0100
commitb2548e23445d44f9b6f0b21d07c0ee94c83d0607 (patch)
tree5e748036fe1f1c8c47607473b0543174af0753f1 /libguile/print.c
parenta964aa62c273d93fad61ae67abd98027e1d142d3 (diff)
downloadguile-b2548e23445d44f9b6f0b21d07c0ee94c83d0607.tar.gz
errno saving in display_string
* libguile/print.c (display_string): Fix a case in which perhaps `errno' could have been stompled.
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/print.c b/libguile/print.c
index 59b109380..3855146b1 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -862,6 +862,8 @@ display_string (const void *str, int narrow_p,
if (SCM_UNLIKELY (done == (size_t) -1))
{
+ int errno_save = errno;
+
/* Reset the `iconv' state. */
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;
printed += codepoints_read;
- if (errno == EILSEQ &&
+ if (errno_save == EILSEQ &&
strategy != SCM_FAILED_CONVERSION_ERROR)
{
/* Conversion failed somewhere in INPUT and we want to