(map_char_table): Check a character is found in range->charset instead
authortomo <tomo>
Thu, 6 Sep 2001 08:57:43 +0000 (08:57 +0000)
committertomo <tomo>
Thu, 6 Sep 2001 08:57:43 +0000 (08:57 +0000)
of non default value is defined in char-table when range is
CHARTAB_RANGE_ROW.

src/chartab.c

index d5cdf69..d85a58f 100644 (file)
@@ -2750,18 +2750,21 @@ map_char_table (Lisp_Char_Table *ct,
        for (retval =0, i = cell_min; i <= cell_max && retval == 0; i++)
          {
            Emchar ch = DECODE_CHAR (range->charset, (range->row << 8) | i);
-           Lisp_Object val
-             = get_byte_table (get_byte_table
-                               (get_byte_table
-                                (get_byte_table
-                                 (ct->table,
-                                  (unsigned char)(ch >> 24)),
-                                 (unsigned char) (ch >> 16)),
-                                (unsigned char)  (ch >> 8)),
-                               (unsigned char)    ch);
-
-           if (!UNBOUNDP (val))
+
+           if ( charset_code_point (range->charset, ch) >= 0 )
              {
+               Lisp_Object val
+                 = get_byte_table (get_byte_table
+                                   (get_byte_table
+                                    (get_byte_table
+                                     (ct->table,
+                                      (unsigned char)(ch >> 24)),
+                                     (unsigned char) (ch >> 16)),
+                                    (unsigned char)  (ch >> 8)),
+                                   (unsigned char)    ch);
+
+               if (UNBOUNDP (val))
+                 val = ct->default_value;
                rainj.ch = ch;
                retval = (fn) (&rainj, val, arg);
              }