Fix conversion to ISO-2022-JP-2 with ISO-8859-7 designation
authorAndreas Schwab <schwab@redhat.com>
Fri, 27 May 2011 12:34:00 +0000 (08:34 -0400)
committerUlrich Drepper <drepper@gmail.com>
Fri, 27 May 2011 12:34:00 +0000 (08:34 -0400)
ChangeLog
NEWS
iconvdata/iso-2022-jp.c

index 5f359bb..beb8281 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-27  Andreas Schwab  <schwab@redhat.com>
+
+       [BZ #12814]
+       * iconvdata/iso-2022-jp.c (BODY): Fix invalid variable shadowing.
+
 2011-05-20  Andreas Schwab  <schwab@redhat.com>
 
        * stdlib/longlong.h: Update from GCC.
diff --git a/NEWS b/NEWS
index f3150f2..1558ba4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-5-22
+GNU C Library NEWS -- history of user-visible changes.  2011-5-27
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -17,7 +17,7 @@ Version 2.14
   12545, 12551, 12582, 12583, 12587, 12597, 12601, 12611, 12625, 12626,
   12631, 12650, 12653, 12655, 12660, 12671, 12681, 12685, 12711, 12713,
   12714, 12717, 12723, 12724, 12734, 12738, 12746, 12766, 12775, 12777,
-  12782, 12788, 12792
+  12782, 12788, 12792, 12814
 
 * The RPC implementation in libc is obsoleted.  Old programs keep working
   but new programs cannot be linked with the routines in libc anymore.
index e14b796..38e4f62 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion module for ISO-2022-JP and ISO-2022-JP-2.
-   Copyright (C) 1998, 1999, 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000-2002, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -664,7 +664,7 @@ static const cvlist_t conversion_lists[4] =
                                                                              \
                        *outptr++ = ESC;                                      \
                        *outptr++ = 'N';                                      \
-                       *outptr++ = res;                                      \
+                       *outptr++ = res & 0x7f;                               \
                        written = 3;                                          \
                      }                                                       \
                  }                                                           \
@@ -706,7 +706,7 @@ static const cvlist_t conversion_lists[4] =
                                                                              \
            /* At the beginning of a line, G2 designation is cleared.  */     \
            if (var == iso2022jp2 && ch == 0x0a)                              \
-             set2 = UNSPECIFIED_set;                                         \
+             set2 = UNSPECIFIED_set;                                         \
          }                                                                   \
        else                                                                  \
          {                                                                   \
@@ -764,9 +764,9 @@ static const cvlist_t conversion_lists[4] =
                        ++rp;                                                 \
                      if (ch >= rp->start)                                    \
                        {                                                     \
-                         unsigned char res =                                 \
+                         unsigned char ch2 =                                 \
                            iso88597_from_ucs4[ch - 0xa0 + rp->idx];          \
-                         if (res != '\0')                                    \
+                         if (ch2 != '\0')                                    \
                            {                                                 \
                              if (set2 != ISO88597_set)                       \
                                {                                             \
@@ -789,7 +789,7 @@ static const cvlist_t conversion_lists[4] =
                                }                                             \
                              *outptr++ = ESC;                                \
                              *outptr++ = 'N';                                \
-                             *outptr++ = res;                                \
+                             *outptr++ = ch2 - 0x80;                         \
                              res = __GCONV_OK;                               \
                              break;                                          \
                            }                                                 \