]> git.eshelyaron.com Git - emacs.git/commitdiff
* coding.c (CODING_ISO_FLAG_LEVEL_4): New macro.
authorKenichi Handa <handa@gnu.org>
Sat, 20 Jul 2013 04:19:05 +0000 (13:19 +0900)
committerKenichi Handa <handa@gnu.org>
Sat, 20 Jul 2013 04:19:05 +0000 (13:19 +0900)
(decode_coding_iso_2022): Check the single-shift area.  (Bug#8522)

lisp/ChangeLog
src/ChangeLog
src/coding.c

index fc38ef046a4e3abe8095c9d7c4fbfb608f5415d3..ccc27f71ac8dc3332e76d46b2231c64ea9f0e906 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-20  Kenichi Handa  <handa@gnu.org>
+
+       * international/mule.el (coding-system-iso-2022-flags): Add
+       `level-4'.  (Bug#8522)
+
 2013-07-18  Michael Albinus  <michael.albinus@gmx.de>
 
        * filenotify.el (file-notify--library): Renamed from
index 8a1c163998ba295c644ca6909355325cb7e83c43..c3a9ee4c1455113023d49c5d6f367c8e5be6201a 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-20  Kenichi Handa  <handa@gnu.org>
+
+       * coding.c (CODING_ISO_FLAG_LEVEL_4): New macro.
+       (decode_coding_iso_2022): Check the single-shift area.  (Bug#8522)
+
 2013-07-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        * filelock.c: Fix unlikely file descriptor leaks.
index e779197bbdedc0f465fc5c495c9b1cb8e97718e0..ad2042672b2cdb88d28ceb0e5cd77a97c2516966 100644 (file)
@@ -493,6 +493,8 @@ enum iso_code_class_type
 
 #define CODING_ISO_FLAG_USE_OLDJIS     0x10000
 
+#define CODING_ISO_FLAG_LEVEL_4                0x20000
+
 #define CODING_ISO_FLAG_FULL_SUPPORT   0x100000
 
 /* A character to be produced on output if encoding of the original
@@ -3733,7 +3735,9 @@ decode_coding_iso_2022 (struct coding_system *coding)
              else
                charset = CHARSET_FROM_ID (charset_id_2);
              ONE_MORE_BYTE (c1);
-             if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
+             if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)
+                 || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4)
+                     ? c1 >= 0x80 : c1 < 0x80))
                goto invalid_code;
              break;
 
@@ -3747,7 +3751,9 @@ decode_coding_iso_2022 (struct coding_system *coding)
              else
                charset = CHARSET_FROM_ID (charset_id_3);
              ONE_MORE_BYTE (c1);
-             if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
+             if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)
+                 || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4)
+                     ? c1 >= 0x80 : c1 < 0x80))
                goto invalid_code;
              break;