XEmacs 21.4.17 "Jumbo Shrimp".
[chise/xemacs-chise.git.1] / src / mule-charset.c
index 86b1652..c541628 100644 (file)
@@ -508,15 +508,22 @@ get_unallocated_leading_byte (int dimension)
 
   if (dimension == 1)
     {
-      if (chlook->next_allocated_1_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_1)
+      if (chlook->next_allocated_1_byte_leading_byte >
+         MAX_LEADING_BYTE_PRIVATE_1)
        lb = 0;
       else
        lb = chlook->next_allocated_1_byte_leading_byte++;
     }
   else
     {
-      if (chlook->next_allocated_2_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_2)
-       lb = 0;
+      /* awfully fragile, but correct */
+#if MAX_LEADING_BYTE_PRIVATE_2 == 255
+      if (chlook->next_allocated_2_byte_leading_byte == 0)
+#else
+      if (chlook->next_allocated_2_byte_leading_byte >
+         MAX_LEADING_BYTE_PRIVATE_2)
+#endif
+        lb = 0;
       else
        lb = chlook->next_allocated_2_byte_leading_byte++;
     }
@@ -693,7 +700,7 @@ character set.  Recognized properties are:
            short_name = value;
          }
 
-       if (EQ (keyword, Qlong_name))
+       else if (EQ (keyword, Qlong_name))
          {
            CHECK_STRING (value);
            long_name = value;
@@ -1320,8 +1327,8 @@ vars_of_mule_charset (void)
 {
   int i, j, k;
 
-  chlook = xnew (struct charset_lookup);
-  dumpstruct (&chlook, &charset_lookup_description);
+  chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */
+  dump_add_root_struct_ptr (&chlook, &charset_lookup_description);
 
   /* Table of charsets indexed by leading byte. */
   for (i = 0; i < countof (chlook->charset_by_leading_byte); i++)