update.
[chise/xemacs-chise.git-] / src / regex.c
index 375cdcf..fe4e6a3 100644 (file)
@@ -352,7 +352,7 @@ char *alloca ();
 
 #define BYTEWIDTH 8 /* In bits.  */
 
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+#define STREQ(s1, s2) (strcmp (s1, s2) == 0)
 
 #undef MAX
 #undef MIN
@@ -2070,9 +2070,9 @@ regex_compile (CONST char *pattern, int size, reg_syntax_t syntax,
                 /* If we get here, we found another repeat character.  */
                 if (!(syntax & RE_NO_MINIMAL_MATCHING))
                   {
-                    /* `*?' and `+?' and `??' are okay (and mean match
-                       minimally), but other sequences (such as `*??' and
-                       `+++') are rejected (reserved for future use). */
+                    /* "*?" and "+?" and "??" are okay (and mean match
+                       minimally), but other sequences (such as "*??" and
+                       "+++") are rejected (reserved for future use). */
                     if (minimal || c != '?')
                       FREE_STACK_RETURN (REG_BADRPT);
                     minimal = true;
@@ -3318,8 +3318,12 @@ compile_extended_range (CONST char **p_ptr, CONST char *pend, char *translate,
      ranges entirely within the first 256 chars. */
 
   if ((range_start >= 0x100 || range_end >= 0x100)
-      && CHAR_LEADING_BYTE (range_start) !=
-      CHAR_LEADING_BYTE (range_end))
+#ifdef UTF2000
+      && CHAR_CHARSET_ID (range_start) != CHAR_CHARSET_ID (range_end)
+#else
+      && CHAR_LEADING_BYTE (range_start) != CHAR_LEADING_BYTE (range_end)
+#endif
+      )
     return REG_ERANGESPAN;
 
   /* As advertised, translations only work over the 0 - 0x7F range.