Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 25 Nov 1999 21:45:54 +0000 (21:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 25 Nov 1999 21:45:54 +0000 (21:45 +0000)
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.

ChangeLog
iconv/gconv.c
iconvdata/iso-2022-jp.c
iconvdata/iso-2022-kr.c

index 0bd8ce7a6095b2b3a7ef93eef5de7955949b86a6..43517638e3bd664b5c436619c0080aaa64f6f5ce 100644 (file)
--- 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
index f51af4a4d8c7153feae8804f1956b103df917ac7..6e3080b0e912351c0703cb3639e9518d3a0f4e86 100644 (file)
@@ -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
        {
index 669b65afaed47a6798761afc06de600243ceaa5f..a3c9f7d354179025e61f4e4ad8418ac4b1602a29 100644 (file)
@@ -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;                              \
index 178753f5c833c3f4a0ff8019a8924b629220a41b..8c1d88b12c890079eff7343184d584a8fc65a5e6 100644 (file)
@@ -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;                              \
            }                                                                 \