- case '[':
- if (*(++ptr) == '^')
- {
- class_optcount = 10; /* Greater than one */
- ptr++;
- }
- else class_optcount = 0;
-
-#ifdef SUPPORT_UTF8
- class_utf8 = FALSE;
-#endif
-
- /* Written as a "do" so that an initial ']' is taken as data */
-
- if (*ptr != 0) do
- {
- /* Inside \Q...\E everything is literal except \E */
-
- if (inescq)
- {
- if (*ptr != '\\' || ptr[1] != 'E') goto GET_ONE_CHARACTER;
- inescq = FALSE;
- ptr += 1;
- continue;
- }
-
- /* Outside \Q...\E, check for escapes */
-
- if (*ptr == '\\')
- {
- c = check_escape(&ptr, &errorcode, bracount, options, TRUE);
- if (errorcode != 0) goto PCRE_ERROR_RETURN;
-
- /* \b is backspace inside a class; \X is literal */
-
- if (-c == ESC_b) c = '\b';
- else if (-c == ESC_X) c = 'X';
-
- /* \Q enters quoting mode */
-
- else if (-c == ESC_Q)
- {
- inescq = TRUE;
- continue;
- }
-
- /* Handle escapes that turn into characters */
-
- if (c >= 0) goto NON_SPECIAL_CHARACTER;
-
- /* Escapes that are meta-things. The normal ones just affect the
- bit map, but Unicode properties require an XCLASS extended item. */
-
- else
- {
- class_optcount = 10; /* \d, \s etc; make sure > 1 */
-#ifdef SUPPORT_UTF8
- if (-c == ESC_p || -c == ESC_P)
- {
- if (!class_utf8)
- {
- class_utf8 = TRUE;
- length += LINK_SIZE + 2;
- }
- length += 2;
- }
-#endif
- }
- }
-
- /* Check the syntax for POSIX stuff. The bits we actually handle are
- checked during the real compile phase. */
-
- else if (*ptr == '[' && check_posix_syntax(ptr, &ptr, &compile_block))
- {
- ptr++;
- class_optcount = 10; /* Make sure > 1 */
- }
-
- /* Anything else increments the possible optimization count. We have to
- detect ranges here so that we can compute the number of extra ranges for
- caseless wide characters when UCP support is available. If there are wide
- characters, we are going to have to use an XCLASS, even for single
- characters. */
-
- else
- {
- int d;
-
- GET_ONE_CHARACTER:
-
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- int extra = 0;
- GETCHARLEN(c, ptr, extra);
- ptr += extra;
- }
- else c = *ptr;
-#else
- c = *ptr;
-#endif
-
- /* Come here from handling \ above when it escapes to a char value */
-
- NON_SPECIAL_CHARACTER:
- class_optcount++;
-
- d = -1;
- if (ptr[1] == '-')
- {
- uschar const *hyptr = ptr++;
- if (ptr[1] == '\\')
- {
- ptr++;
- d = check_escape(&ptr, &errorcode, bracount, options, TRUE);
- if (errorcode != 0) goto PCRE_ERROR_RETURN;
- if (-d == ESC_b) d = '\b'; /* backspace */
- else if (-d == ESC_X) d = 'X'; /* literal X in a class */
- }
- else if (ptr[1] != 0 && ptr[1] != ']')
- {
- ptr++;
-#ifdef SUPPORT_UTF8
- if (utf8)
- {
- int extra = 0;
- GETCHARLEN(d, ptr, extra);
- ptr += extra;
- }
- else
-#endif
- d = *ptr;
- }
- if (d < 0) ptr = hyptr; /* go back to hyphen as data */
- }
-
- /* If d >= 0 we have a range. In UTF-8 mode, if the end is > 255, or >
- 127 for caseless matching, we will need to use an XCLASS. */
-
- if (d >= 0)
- {
- class_optcount = 10; /* Ensure > 1 */
- if (d < c)
- {
- errorcode = ERR8;
- goto PCRE_ERROR_RETURN;
- }
-
-#ifdef SUPPORT_UTF8
- if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127)))
- {
- uschar buffer[6];
- if (!class_utf8) /* Allow for XCLASS overhead */
- {
- class_utf8 = TRUE;
- length += LINK_SIZE + 2;
- }
-
-#ifdef SUPPORT_UCP
- /* If we have UCP support, find out how many extra ranges are
- needed to map the other case of characters within this range. We
- have to mimic the range optimization here, because extending the
- range upwards might push d over a boundary that makes is use
- another byte in the UTF-8 representation. */
-
- if ((options & PCRE_CASELESS) != 0)
- {
- int occ, ocd;
- int cc = c;
- int origd = d;
- while (get_othercase_range(&cc, origd, &occ, &ocd))
- {
- if (occ >= c && ocd <= d) continue; /* Skip embedded */
-
- if (occ < c && ocd >= c - 1) /* Extend the basic range */
- { /* if there is overlap, */
- c = occ; /* noting that if occ < c */
- continue; /* we can't have ocd > d */
- } /* because a subrange is */
- if (ocd > d && occ <= d + 1) /* always shorter than */
- { /* the basic range. */
- d = ocd;
- continue;
- }
-
- /* An extra item is needed */
-
- length += 1 + _pcre_ord2utf8(occ, buffer) +
- ((occ == ocd)? 0 : _pcre_ord2utf8(ocd, buffer));
- }
- }
-#endif /* SUPPORT_UCP */
-
- /* The length of the (possibly extended) range */
-
- length += 1 + _pcre_ord2utf8(c, buffer) + _pcre_ord2utf8(d, buffer);
- }
-#endif /* SUPPORT_UTF8 */
-
- }
-
- /* We have a single character. There is nothing to be done unless we
- are in UTF-8 mode. If the char is > 255, or 127 when caseless, we must
- allow for an XCL_SINGLE item, doubled for caselessness if there is UCP
- support. */
-
- else
- {
-#ifdef SUPPORT_UTF8
- if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))
- {
- uschar buffer[6];
- class_optcount = 10; /* Ensure > 1 */
- if (!class_utf8) /* Allow for XCLASS overhead */
- {
- class_utf8 = TRUE;
- length += LINK_SIZE + 2;
- }
-#ifdef SUPPORT_UCP
- length += (((options & PCRE_CASELESS) != 0)? 2 : 1) *
- (1 + _pcre_ord2utf8(c, buffer));
-#else /* SUPPORT_UCP */
- length += 1 + _pcre_ord2utf8(c, buffer);
-#endif /* SUPPORT_UCP */
- }
-#endif /* SUPPORT_UTF8 */
- }
- }
- }
- while (*(++ptr) != 0 && (inescq || *ptr != ']')); /* Concludes "do" above */
-
- if (*ptr == 0) /* Missing terminating ']' */
- {
- errorcode = ERR6;
- goto PCRE_ERROR_RETURN;
- }
-
- /* We can optimize when there was only one optimizable character. Repeats
- for positive and negated single one-byte chars are handled by the general
- code. Here, we handle repeats for the class opcodes. */
-
- if (class_optcount == 1) length += 3; else
- {
- length += 33;
-
- /* A repeat needs either 1 or 5 bytes. If it is a possessive quantifier,
- we also need extra for wrapping the whole thing in a sub-pattern. */
-
- if (*ptr != 0 && ptr[1] == '{' && is_counted_repeat(ptr+2))
- {
- ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode);
- if (errorcode != 0) goto PCRE_ERROR_RETURN;
- if ((min == 0 && (max == 1 || max == -1)) ||
- (min == 1 && max == -1))
- length++;
- else length += 5;
- if (ptr[1] == '+')
- {
- ptr++;
- length += 2 + 2*LINK_SIZE;
- }
- else if (ptr[1] == '?') ptr++;
- }
- }
- continue;
-
- /* Brackets may be genuine groups or special things */
-
- case '(':
- branch_newextra = 0;
- bracket_length = 1 + LINK_SIZE;
-
- /* Handle special forms of bracket, which all start (? */
-
- if (ptr[1] == '?')
- {
- int set, unset;
- int *optset;
-
- switch (c = ptr[2])
- {
- /* Skip over comments entirely */
- case '#':
- ptr += 3;
- while (*ptr != 0 && *ptr != ')') ptr++;
- if (*ptr == 0)
- {
- errorcode = ERR18;
- goto PCRE_ERROR_RETURN;
- }
- continue;
-
- /* Non-referencing groups and lookaheads just move the pointer on, and
- then behave like a non-special bracket, except that they don't increment
- the count of extracting brackets. Ditto for the "once only" bracket,
- which is in Perl from version 5.005. */
-
- case ':':
- case '=':
- case '!':
- case '>':
- ptr += 2;
- break;
-
- /* (?R) specifies a recursive call to the regex, which is an extension
- to provide the facility which can be obtained by (?p{perl-code}) in
- Perl 5.6. In Perl 5.8 this has become (??{perl-code}).
-
- From PCRE 4.00, items such as (?3) specify subroutine-like "calls" to
- the appropriate numbered brackets. This includes both recursive and
- non-recursive calls. (?R) is now synonymous with (?0). */
-
- case 'R':
- ptr++;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- ptr += 2;
- if (c != 'R')
- while ((digitab[*(++ptr)] & ctype_digit) != 0);
- if (*ptr != ')')
- {
- errorcode = ERR29;
- goto PCRE_ERROR_RETURN;
- }
- length += 1 + LINK_SIZE;
-
- /* If this item is quantified, it will get wrapped inside brackets so
- as to use the code for quantified brackets. We jump down and use the
- code that handles this for real brackets. */
-
- if (ptr[1] == '+' || ptr[1] == '*' || ptr[1] == '?' || ptr[1] == '{')
- {
- length += 2 + 2 * LINK_SIZE; /* to make bracketed */
- duplength = 5 + 3 * LINK_SIZE;
- goto HANDLE_QUANTIFIED_BRACKETS;
- }
- continue;
-
- /* (?C) is an extension which provides "callout" - to provide a bit of
- the functionality of the Perl (?{...}) feature. An optional number may
- follow (default is zero). */
-
- case 'C':
- ptr += 2;
- while ((digitab[*(++ptr)] & ctype_digit) != 0);
- if (*ptr != ')')
- {
- errorcode = ERR39;
- goto PCRE_ERROR_RETURN;
- }
- length += 2 + 2*LINK_SIZE;
- continue;
-
- /* Named subpatterns are an extension copied from Python */
-
- case 'P':
- ptr += 3;
- if (*ptr == '<')
- {
- const uschar *p; /* Don't amalgamate; some compilers */
- p = ++ptr; /* grumble at autoincrement in declaration */
- while ((compile_block.ctypes[*ptr] & ctype_word) != 0) ptr++;
- if (*ptr != '>')
- {
- errorcode = ERR42;
- goto PCRE_ERROR_RETURN;
- }
- name_count++;
- if (ptr - p > max_name_size) max_name_size = (ptr - p);
- break;
- }
-
- if (*ptr == '=' || *ptr == '>')
- {
- while ((compile_block.ctypes[*(++ptr)] & ctype_word) != 0);
- if (*ptr != ')')
- {
- errorcode = ERR42;
- goto PCRE_ERROR_RETURN;
- }
- break;
- }
-
- /* Unknown character after (?P */
-
- errorcode = ERR41;
- goto PCRE_ERROR_RETURN;
-
- /* Lookbehinds are in Perl from version 5.005 */
-
- case '<':
- ptr += 3;
- if (*ptr == '=' || *ptr == '!')
- {
- branch_newextra = 1 + LINK_SIZE;
- length += 1 + LINK_SIZE; /* For the first branch */
- break;
- }
- errorcode = ERR24;
- goto PCRE_ERROR_RETURN;
-
- /* Conditionals are in Perl from version 5.005. The bracket must either
- be followed by a number (for bracket reference) or by an assertion
- group, or (a PCRE extension) by 'R' for a recursion test. */
-
- case '(':
- if (ptr[3] == 'R' && ptr[4] == ')')
- {
- ptr += 4;
- length += 3;
- }
- else if ((digitab[ptr[3]] & ctype_digit) != 0)
- {
- ptr += 4;
- length += 3;
- while ((digitab[*ptr] & ctype_digit) != 0) ptr++;
- if (*ptr != ')')
- {
- errorcode = ERR26;
- goto PCRE_ERROR_RETURN;
- }
- }
- else /* An assertion must follow */
- {
- ptr++; /* Can treat like ':' as far as spacing is concerned */
- if (ptr[2] != '?' ||
- (ptr[3] != '=' && ptr[3] != '!' && ptr[3] != '<') )
- {
- ptr += 2; /* To get right offset in message */
- errorcode = ERR28;
- goto PCRE_ERROR_RETURN;
- }
- }
- break;
-
- /* Else loop checking valid options until ) is met. Anything else is an
- error. If we are without any brackets, i.e. at top level, the settings
- act as if specified in the options, so massage the options immediately.
- This is for backward compatibility with Perl 5.004. */
-
- default:
- set = unset = 0;
- optset = &set;
- ptr += 2;
-
- for (;; ptr++)
- {
- c = *ptr;
- switch (c)
- {
- case 'i':
- *optset |= PCRE_CASELESS;
- continue;
-
- case 'm':
- *optset |= PCRE_MULTILINE;
- continue;
-
- case 's':
- *optset |= PCRE_DOTALL;
- continue;
-
- case 'x':
- *optset |= PCRE_EXTENDED;
- continue;
-
- case 'X':
- *optset |= PCRE_EXTRA;
- continue;
-
- case 'U':
- *optset |= PCRE_UNGREEDY;
- continue;
-
- case '-':
- optset = &unset;
- continue;
-
- /* A termination by ')' indicates an options-setting-only item; if
- this is at the very start of the pattern (indicated by item_count
- being zero), we use it to set the global options. This is helpful
- when analyzing the pattern for first characters, etc. Otherwise
- nothing is done here and it is handled during the compiling
- process.
-
- [Historical note: Up to Perl 5.8, options settings at top level
- were always global settings, wherever they appeared in the pattern.
- That is, they were equivalent to an external setting. From 5.8
- onwards, they apply only to what follows (which is what you might
- expect).] */
-
- case ')':
- if (item_count == 0)
- {
- options = (options | set) & (~unset);
- set = unset = 0; /* To save length */
- item_count--; /* To allow for several */
- }
-
- /* Fall through */
-
- /* A termination by ':' indicates the start of a nested group with
- the given options set. This is again handled at compile time, but
- we must allow for compiled space if any of the ims options are
- set. We also have to allow for resetting space at the end of
- the group, which is why 4 is added to the length and not just 2.
- If there are several changes of options within the same group, this
- will lead to an over-estimate on the length, but this shouldn't
- matter very much. We also have to allow for resetting options at
- the start of any alternations, which we do by setting
- branch_newextra to 2. Finally, we record whether the case-dependent
- flag ever changes within the regex. This is used by the "required
- character" code. */
-
- case ':':
- if (((set|unset) & PCRE_IMS) != 0)
- {
- length += 4;
- branch_newextra = 2;
- if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED;
- }
- goto END_OPTIONS;
-
- /* Unrecognized option character */
-
- default:
- errorcode = ERR12;
- goto PCRE_ERROR_RETURN;
- }
- }
-
- /* If we hit a closing bracket, that's it - this is a freestanding
- option-setting. We need to ensure that branch_extra is updated if
- necessary. The only values branch_newextra can have here are 0 or 2.
- If the value is 2, then branch_extra must either be 2 or 5, depending
- on whether this is a lookbehind group or not. */
-
- END_OPTIONS:
- if (c == ')')
- {
- if (branch_newextra == 2 &&
- (branch_extra == 0 || branch_extra == 1+LINK_SIZE))
- branch_extra += branch_newextra;
- continue;
- }
-
- /* If options were terminated by ':' control comes here. Fall through
- to handle the group below. */
- }
- }
-
- /* Extracting brackets must be counted so we can process escapes in a
- Perlish way. If the number exceeds EXTRACT_BASIC_MAX we are going to
- need an additional 3 bytes of store per extracting bracket. However, if
- PCRE_NO_AUTO)CAPTURE is set, unadorned brackets become non-capturing, so we
- must leave the count alone (it will aways be zero). */
-
- else if ((options & PCRE_NO_AUTO_CAPTURE) == 0)
- {
- bracount++;
- if (bracount > EXTRACT_BASIC_MAX) bracket_length += 3;
- }
-
- /* Save length for computing whole length at end if there's a repeat that
- requires duplication of the group. Also save the current value of
- branch_extra, and start the new group with the new value. If non-zero, this
- will either be 2 for a (?imsx: group, or 3 for a lookbehind assertion. */
-
- if (brastackptr >= sizeof(brastack)/sizeof(int))
- {
- errorcode = ERR19;
- goto PCRE_ERROR_RETURN;
- }
-
- bralenstack[brastackptr] = branch_extra;
- branch_extra = branch_newextra;
-
- brastack[brastackptr++] = length;
- length += bracket_length;
- continue;
-
- /* Handle ket. Look for subsequent max/min; for certain sets of values we
- have to replicate this bracket up to that many times. If brastackptr is
- 0 this is an unmatched bracket which will generate an error, but take care
- not to try to access brastack[-1] when computing the length and restoring
- the branch_extra value. */
-
- case ')':
- length += 1 + LINK_SIZE;
- if (brastackptr > 0)
- {
- duplength = length - brastack[--brastackptr];
- branch_extra = bralenstack[brastackptr];
- }
- else duplength = 0;
-
- /* The following code is also used when a recursion such as (?3) is
- followed by a quantifier, because in that case, it has to be wrapped inside
- brackets so that the quantifier works. The value of duplength must be
- set before arrival. */
-
- HANDLE_QUANTIFIED_BRACKETS:
-
- /* Leave ptr at the final char; for read_repeat_counts this happens
- automatically; for the others we need an increment. */
-
- if ((c = ptr[1]) == '{' && is_counted_repeat(ptr+2))
- {
- ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode);
- if (errorcode != 0) goto PCRE_ERROR_RETURN;
- }
- else if (c == '*') { min = 0; max = -1; ptr++; }
- else if (c == '+') { min = 1; max = -1; ptr++; }
- else if (c == '?') { min = 0; max = 1; ptr++; }
- else { min = 1; max = 1; }
-
- /* If the minimum is zero, we have to allow for an OP_BRAZERO before the
- group, and if the maximum is greater than zero, we have to replicate
- maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting
- bracket set. */
-
- if (min == 0)
- {
- length++;
- if (max > 0) length += (max - 1) * (duplength + 3 + 2*LINK_SIZE);
- }
-
- /* When the minimum is greater than zero, we have to replicate up to
- minval-1 times, with no additions required in the copies. Then, if there
- is a limited maximum we have to replicate up to maxval-1 times allowing
- for a BRAZERO item before each optional copy and nesting brackets for all
- but one of the optional copies. */
-
- else
- {
- length += (min - 1) * duplength;
- if (max > min) /* Need this test as max=-1 means no limit */
- length += (max - min) * (duplength + 3 + 2*LINK_SIZE)
- - (2 + 2*LINK_SIZE);
- }
-
- /* Allow space for once brackets for "possessive quantifier" */
-
- if (ptr[1] == '+')
- {
- ptr++;
- length += 2 + 2*LINK_SIZE;
- }
- continue;
-
- /* Non-special character. It won't be space or # in extended mode, so it is
- always a genuine character. If we are in a \Q...\E sequence, check for the
- end; if not, we have a literal. */
-
- default:
- NORMAL_CHAR:
-
- if (inescq && c == '\\' && ptr[1] == 'E')
- {
- inescq = FALSE;
- ptr++;
- continue;
- }
-
- length += 2; /* For a one-byte character */
- lastitemlength = 1; /* Default length of last item for repeats */
-
- /* In UTF-8 mode, check for additional bytes. */
-
-#ifdef SUPPORT_UTF8
- if (utf8 && (c & 0xc0) == 0xc0)
- {
- while ((ptr[1] & 0xc0) == 0x80) /* Can't flow over the end */
- { /* because the end is marked */
- lastitemlength++; /* by a zero byte. */
- length++;
- ptr++;
- }
- }
-#endif
-
- continue;
- }
- }
-
-length += 2 + LINK_SIZE; /* For final KET and END */
-
-if ((options & PCRE_AUTO_CALLOUT) != 0)
- length += 2 + 2*LINK_SIZE; /* For final callout */
-
-if (length > MAX_PATTERN_SIZE)
- {
- errorcode = ERR20;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Compute the size of data block needed and get it, either from malloc or
-externally provided function. */
-
-size = length + sizeof(real_pcre) + name_count * (max_name_size + 3);
-re = (real_pcre *)(pcre_malloc)(size);
-
-if (re == NULL)
- {
- errorcode = ERR21;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Put in the magic number, and save the sizes, options, and character table
-pointer. NULL is used for the default character tables. The nullpad field is at
-the end; it's there to help in the case when a regex compiled on a system with
-4-byte pointers is run on another with 8-byte pointers. */
-
-re->magic_number = MAGIC_NUMBER;
-re->size = size;
-re->options = options;
-re->dummy1 = 0;
-re->name_table_offset = sizeof(real_pcre);
-re->name_entry_size = max_name_size + 3;
-re->name_count = name_count;
-re->ref_count = 0;
-re->tables = (tables == _pcre_default_tables)? NULL : tables;
-re->nullpad = NULL;
-
-/* The starting points of the name/number translation table and of the code are
-passed around in the compile data block. */
-
-compile_block.names_found = 0;
-compile_block.name_entry_size = max_name_size + 3;
-compile_block.name_table = (uschar *)re + re->name_table_offset;
-codestart = compile_block.name_table + re->name_entry_size * re->name_count;
-compile_block.start_code = codestart;
-compile_block.start_pattern = (const uschar *)pattern;
-compile_block.req_varyopt = 0;
-compile_block.nopartial = FALSE;
-
-/* Set up a starting, non-extracting bracket, then compile the expression. On
-error, errorcode will be set non-zero, so we don't need to look at the result
-of the function here. */
-
-ptr = (const uschar *)pattern;
-code = (uschar *)codestart;
-*code = OP_BRA;
-bracount = 0;
-(void)compile_regex(options, options & PCRE_IMS, &bracount, &code, &ptr,
- &errorcode, FALSE, 0, &firstbyte, &reqbyte, NULL, &compile_block);
-re->top_bracket = bracount;
-re->top_backref = compile_block.top_backref;
-
-if (compile_block.nopartial) re->options |= PCRE_NOPARTIAL;
-
-/* If not reached end of pattern on success, there's an excess bracket. */
-
-if (errorcode == 0 && *ptr != 0) errorcode = ERR22;
-
-/* Fill in the terminating state and check for disastrous overflow, but
-if debugging, leave the test till after things are printed out. */
-
-*code++ = OP_END;
-
-#ifndef DEBUG
-if (code - codestart > length) errorcode = ERR23;
-#endif
-
-/* Give an error if there's back reference to a non-existent capturing
-subpattern. */
-
-if (re->top_backref > re->top_bracket) errorcode = ERR15;
-
-/* Failed to compile, or error while post-processing */
-
-if (errorcode != 0)
- {
- (pcre_free)(re);
- PCRE_ERROR_RETURN:
- *erroroffset = ptr - (const uschar *)pattern;
- PCRE_EARLY_ERROR_RETURN:
- *errorptr = error_texts[errorcode];
- if (errorcodeptr != NULL) *errorcodeptr = errorcode;
- return NULL;
- }
-
-/* If the anchored option was not passed, set the flag if we can determine that
-the pattern is anchored by virtue of ^ characters or \A or anything else (such
-as starting with .* when DOTALL is set).
-
-Otherwise, if we know what the first character has to be, save it, because that
-speeds up unanchored matches no end. If not, see if we can set the
-PCRE_STARTLINE flag. This is helpful for multiline matches when all branches
-start with ^. and also when all branches start with .* for non-DOTALL matches.
-*/
-
-if ((options & PCRE_ANCHORED) == 0)
- {
- int temp_options = options;
- if (is_anchored(codestart, &temp_options, 0, compile_block.backref_map))
- re->options |= PCRE_ANCHORED;
- else
- {
- if (firstbyte < 0)
- firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE);
- if (firstbyte >= 0) /* Remove caseless flag for non-caseable chars */
- {
- int ch = firstbyte & 255;
- re->first_byte = ((firstbyte & REQ_CASELESS) != 0 &&
- compile_block.fcc[ch] == ch)? ch : firstbyte;
- re->options |= PCRE_FIRSTSET;
- }
- else if (is_startline(codestart, 0, compile_block.backref_map))
- re->options |= PCRE_STARTLINE;
- }
- }
-
-/* For an anchored pattern, we use the "required byte" only if it follows a
-variable length item in the regex. Remove the caseless flag for non-caseable
-bytes. */
-
-if (reqbyte >= 0 &&
- ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0))
- {
- int ch = reqbyte & 255;
- re->req_byte = ((reqbyte & REQ_CASELESS) != 0 &&
- compile_block.fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte;
- re->options |= PCRE_REQCHSET;
- }
-
-/* Print out the compiled data for debugging */
-
-#ifdef DEBUG