aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-25 21:45:54 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-25 21:45:54 +0000
commit4a4229213a59016e35a7abdac5cea91d4fcbb178 (patch)
treea40f47f99553083ad9658ea10dd64cf875514c7f
parentc559a3ca84a0258e4773571ae73fa7bba4c927b0 (diff)
downloadglibc-4a4229213a59016e35a7abdac5cea91d4fcbb178.zip
glibc-4a4229213a59016e35a7abdac5cea91d4fcbb178.tar.gz
glibc-4a4229213a59016e35a7abdac5cea91d4fcbb178.tar.bz2
Update.
1999-11-25 Ulrich Drepper <drepper@cygnus.com> * iconv/gconv.c (__gconv): Always initialize cd->__data[last_step].__outbuf and cd->__data[last_step].__outbufend. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Update number of written bytes. * iconvdata/iso-2022-jp.c: Likewise.
-rw-r--r--ChangeLog9
-rw-r--r--iconv/gconv.c5
-rw-r--r--iconvdata/iso-2022-jp.c2
-rw-r--r--iconvdata/iso-2022-kr.c2
4 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bd8ce7..4351763 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1999-11-25 Ulrich Drepper <drepper@cygnus.com>
+
+ * iconv/gconv.c (__gconv): Always initialize
+ cd->__data[last_step].__outbuf and cd->__data[last_step].__outbufend.
+
+ * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Update number of
+ written bytes.
+ * iconvdata/iso-2022-jp.c: Likewise.
+
1999-11-25 H.J. Lu <hjl@gnu.org>
* stdlib/exit.c (exit): Run funtions only if
diff --git a/iconv/gconv.c b/iconv/gconv.c
index f51af4a..6e3080b 100644
--- a/iconv/gconv.c
+++ b/iconv/gconv.c
@@ -39,6 +39,9 @@ __gconv (__gconv_t cd, const unsigned char **inbuf,
assert (converted != NULL);
*converted = 0;
+ cd->__data[last_step].__outbuf = *outbuf;
+ cd->__data[last_step].__outbufend = outbufend;
+
if (inbuf == NULL || *inbuf == NULL)
/* We just flush. */
result = DL_CALL_FCT (cd->__steps->__fct,
@@ -49,8 +52,6 @@ __gconv (__gconv_t cd, const unsigned char **inbuf,
const unsigned char *last_start;
assert (outbuf != NULL && *outbuf != NULL);
- cd->__data[last_step].__outbuf = *outbuf;
- cd->__data[last_step].__outbufend = outbufend;
do
{
diff --git a/iconvdata/iso-2022-jp.c b/iconvdata/iso-2022-jp.c
index 669b65a..a3c9f7d 100644
--- a/iconvdata/iso-2022-jp.c
+++ b/iconvdata/iso-2022-jp.c
@@ -212,6 +212,8 @@ gconv_end (struct __gconv_step *data)
*outbuf++ = ESC; \
*outbuf++ = '('; \
*outbuf++ = 'B'; \
+ if (data->__is_last) \
+ *written += 3; \
data->__outbuf = outbuf; \
/* Note that this also clears the G2 designation. */ \
data->__statep->count = ASCII_set; \
diff --git a/iconvdata/iso-2022-kr.c b/iconvdata/iso-2022-kr.c
index 178753f..8c1d88b 100644
--- a/iconvdata/iso-2022-kr.c
+++ b/iconvdata/iso-2022-kr.c
@@ -92,6 +92,8 @@ enum
{ \
/* Write out the shift sequence. */ \
*outbuf++ = SI; \
+ if (data->__is_last) \
+ *written += 1; \
data->__outbuf = outbuf; \
data->__statep->count = ASCII_set; \
} \