--- src/regex.c Sun Nov 15 20:52:09 2009 +0000 +++ src/regex.c Mon Nov 16 19:44:33 2009 +0000 @@ -35,6 +35,7 @@ /* We assume non-Mule if emacs isn't defined. */ #ifndef emacs #undef MULE +#define MAX_ICHAR_LEN 1 #endif /* XEmacs addition */ @@ -3340,9 +3341,6 @@ normal_char: { /* XEmacs: modifications here for Mule. */ - /* `q' points to the beginning of the next char. */ - re_char *q = p; - /* If no exactn currently being built. */ if (!pending_exact @@ -3350,18 +3348,17 @@ || pending_exact + *pending_exact + 1 != buf_end /* We have only one byte following the exactn for the count. */ - || ((unsigned int) (*pending_exact + (q - p)) >= - ((unsigned int) (1 << BYTEWIDTH) - 1)) + || *pending_exact >= (1 << BYTEWIDTH) - MAX_ICHAR_LEN /* If followed by a repetition operator. */ - || *q == '*' || *q == '^' + || (p != pend && (*p == '*' || *p == '^')) || ((syntax & RE_BK_PLUS_QM) - ? *q == '\\' && (q[1] == '+' || q[1] == '?') - : (*q == '+' || *q == '?')) + ? p + 1 < pend && *p == '\\' && (p[1] == '+' || p[1] == '?') + : p != pend && (*p == '+' || *p == '?')) || ((syntax & RE_INTERVALS) && ((syntax & RE_NO_BK_BRACES) - ? *q == '{' - : (q[0] == '\\' && q[1] == '{')))) + ? p != pend && *p == '{' + : p + 1 < pend && (p[0] == '\\' && p[1] == '{')))) { /* Start building a new exactn. */