# HG changeset patch # User Richard Stallman # Date 777165230 0 # Node ID adaf7155fb9e8c0f299b9bbada3a64ab510f763f # Parent b860efa9524a5d524f0408fe8fad7535dd19b0a0 (regex_compile): Split an if to avoid compiler bug. (re_match_2_internal): Use separate if to compute bestmatch_p. diff -r b860efa9524a -r adaf7155fb9e regex.c --- a/regex.c Sun Jul 31 20:59:32 1994 +0000 +++ b/regex.c Wed Aug 17 23:13:50 1994 +0000 @@ -1922,19 +1922,23 @@ for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { + /* This was split into 3 if's to + avoid an arbitrary limit in some compiler. */ if ( (is_alnum && ISALNUM (ch)) || (is_alpha && ISALPHA (ch)) || (is_blank && ISBLANK (ch)) - || (is_cntrl && ISCNTRL (ch)) - || (is_digit && ISDIGIT (ch)) + || (is_cntrl && ISCNTRL (ch))) + SET_LIST_BIT (ch); + if ( (is_digit && ISDIGIT (ch)) || (is_graph && ISGRAPH (ch)) || (is_lower && ISLOWER (ch)) - || (is_print && ISPRINT (ch)) - || (is_punct && ISPUNCT (ch)) + || (is_print && ISPRINT (ch))) + SET_LIST_BIT (ch); + if ( (is_punct && ISPUNCT (ch)) || (is_space && ISSPACE (ch)) || (is_upper && ISUPPER (ch)) || (is_xdigit && ISXDIGIT (ch))) - SET_LIST_BIT (ch); + SET_LIST_BIT (ch); } had_char_class = true; } @@ -3602,8 +3606,14 @@ boolean same_str_p = (FIRST_STRING_P (match_end) == MATCHING_IN_FIRST_STRING); /* 1 if this match is the best seen so far. */ - boolean best_match_p = (same_str_p ? d > match_end - : !MATCHING_IN_FIRST_STRING); + boolean best_match_p; + + /* AIX compiler got confused when this was combined + with the previous declaration. */ + if (same_str_p) + best_match_p = d > match_end; + else + best_match_p = !MATCHING_IN_FIRST_STRING; DEBUG_PRINT1 ("backtracking.\n");