about summary refs log tree commit diff
path: root/iconvdata
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-05-27 08:34:00 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-27 08:34:00 -0400
commit4d07db153ea9acc5c3201647bd06024e5801ae89 (patch)
treea317c2b6b64b17143ee2b4c732f173a902bd6cb4 /iconvdata
parentdef7fbd6c66552842216bbfb828caf223a2322bf (diff)
downloadglibc-4d07db153ea9acc5c3201647bd06024e5801ae89.tar.gz
glibc-4d07db153ea9acc5c3201647bd06024e5801ae89.tar.xz
glibc-4d07db153ea9acc5c3201647bd06024e5801ae89.zip
Fix conversion to ISO-2022-JP-2 with ISO-8859-7 designation
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/iso-2022-jp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/iconvdata/iso-2022-jp.c b/iconvdata/iso-2022-jp.c
index e14b79615b..38e4f6284a 100644
--- a/iconvdata/iso-2022-jp.c
+++ b/iconvdata/iso-2022-jp.c
@@ -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;					      \
 			    }						      \