2832 |
Arguments: |
Arguments: |
2833 |
p points after the leading '<' |
p points after the leading '<' |
2834 |
f file for error message |
f file for error message |
2835 |
nl TRUE to check only for newline settings |
nl TRUE to check only for newline settings |
2836 |
stype "modifier" or "escape sequence" |
stype "modifier" or "escape sequence" |
2837 |
|
|
2838 |
Returns: appropriate PCRE_NEWLINE_xxx flags, or 0 |
Returns: appropriate PCRE_NEWLINE_xxx flags, or 0 |
2839 |
*/ |
*/ |
2852 |
if (!nl) |
if (!nl) |
2853 |
{ |
{ |
2854 |
if (strncmpic(p, (pcre_uint8 *)"JS>", 3) == 0) return PCRE_JAVASCRIPT_COMPAT; |
if (strncmpic(p, (pcre_uint8 *)"JS>", 3) == 0) return PCRE_JAVASCRIPT_COMPAT; |
2855 |
} |
} |
2856 |
|
|
2857 |
fprintf(f, "Unknown %s at: <%s\n", stype, p); |
fprintf(f, "Unknown %s at: <%s\n", stype, p); |
2858 |
return 0; |
return 0; |
2901 |
printf(" -i show information about compiled patterns\n" |
printf(" -i show information about compiled patterns\n" |
2902 |
" -M find MATCH_LIMIT minimum for each subject\n" |
" -M find MATCH_LIMIT minimum for each subject\n" |
2903 |
" -m output memory used information\n" |
" -m output memory used information\n" |
2904 |
" -O set PCRE_NO_AUTO_POSSESS on each pattern\n" |
" -O set PCRE_NO_AUTO_POSSESS on each pattern\n" |
2905 |
" -o <n> set size of offsets vector to <n>\n"); |
" -o <n> set size of offsets vector to <n>\n"); |
2906 |
#if !defined NOPOSIX |
#if !defined NOPOSIX |
2907 |
printf(" -p use POSIX interface\n"); |
printf(" -p use POSIX interface\n"); |
3102 |
{ |
{ |
3103 |
int temp; |
int temp; |
3104 |
int both = arg[2] == 0; |
int both = arg[2] == 0; |
3105 |
showtotaltimes = arg[1] == 'T'; |
showtotaltimes = arg[1] == 'T'; |
3106 |
if (argc > 2 && (temp = get_value((pcre_uint8 *)argv[op+1], &endptr), |
if (argc > 2 && (temp = get_value((pcre_uint8 *)argv[op+1], &endptr), |
3107 |
*endptr == 0)) |
*endptr == 0)) |
3108 |
{ |
{ |
3447 |
p = buffer; |
p = buffer; |
3448 |
while (isspace(*p)) p++; |
while (isspace(*p)) p++; |
3449 |
if (*p == 0) continue; |
if (*p == 0) continue; |
3450 |
|
|
3451 |
/* Handle option lock-out setting */ |
/* Handle option lock-out setting */ |
3452 |
|
|
3453 |
if (*p == '<' && p[1] == ' ') |
if (*p == '<' && p[1] == ' ') |
3454 |
{ |
{ |
3455 |
p += 2; |
p += 2; |
3458 |
{ |
{ |
3459 |
p += 7; |
p += 7; |
3460 |
while (isspace(*p)) p++; |
while (isspace(*p)) p++; |
3461 |
pp = lockout; |
pp = lockout; |
3462 |
while (!isspace(*p) && pp < lockout + sizeof(lockout) - 1) |
while (!isspace(*p) && pp < lockout + sizeof(lockout) - 1) |
3463 |
*pp++ = *p++; |
*pp++ = *p++; |
3464 |
*pp = 0; |
*pp = 0; |
3465 |
} |
} |
3466 |
else |
else |
3467 |
{ |
{ |
3468 |
printf("** Unrecognized special command '%s'\n", p); |
printf("** Unrecognized special command '%s'\n", p); |
3469 |
yield = 1; |
yield = 1; |
3470 |
goto EXIT; |
goto EXIT; |
3471 |
} |
} |
3472 |
continue; |
continue; |
3473 |
} |
} |
3474 |
|
|
3475 |
/* See if the pattern is to be loaded pre-compiled from a file. */ |
/* See if the pattern is to be loaded pre-compiled from a file. */ |
3476 |
|
|
3660 |
while (*pp != 0) |
while (*pp != 0) |
3661 |
{ |
{ |
3662 |
/* Check to see whether this modifier has been locked out for this file. |
/* Check to see whether this modifier has been locked out for this file. |
3663 |
This is complicated for the multi-character options that begin with '<'. |
This is complicated for the multi-character options that begin with '<'. |
3664 |
If there is no '>' in the lockout string, all multi-character modifiers are |
If there is no '>' in the lockout string, all multi-character modifiers are |
3665 |
locked out. */ |
locked out. */ |
3666 |
|
|
3667 |
if (strchr((char *)lockout, *pp) != NULL) |
if (strchr((char *)lockout, *pp) != NULL) |
3668 |
{ |
{ |
3669 |
if (*pp == '<' && strchr((char *)lockout, '>') != NULL) |
if (*pp == '<' && strchr((char *)lockout, '>') != NULL) |
3670 |
{ |
{ |
3671 |
int x = check_mc_option(pp+1, outfile, FALSE, "modifier"); |
int x = check_mc_option(pp+1, outfile, FALSE, "modifier"); |
3672 |
if (x == 0) goto SKIP_DATA; |
if (x == 0) goto SKIP_DATA; |
3673 |
|
|
3674 |
for (ppp = lockout; *ppp != 0; ppp++) |
for (ppp = lockout; *ppp != 0; ppp++) |
3675 |
{ |
{ |
3676 |
if (*ppp == '<') |
if (*ppp == '<') |
3680 |
{ |
{ |
3681 |
printf("** Error in modifier forbid data - giving up.\n"); |
printf("** Error in modifier forbid data - giving up.\n"); |
3682 |
yield = 1; |
yield = 1; |
3683 |
goto EXIT; |
goto EXIT; |
3684 |
} |
} |
3685 |
if (x == y) |
if (x == y) |
3686 |
{ |
{ |
3687 |
ppp = pp; |
ppp = pp; |
3688 |
while (*ppp != '>') ppp++; |
while (*ppp != '>') ppp++; |
3689 |
printf("** The %.*s modifier is locked out - giving up.\n", |
printf("** The %.*s modifier is locked out - giving up.\n", |
3690 |
(int)(ppp - pp + 1), pp); |
(int)(ppp - pp + 1), pp); |
3691 |
yield = 1; |
yield = 1; |
3692 |
goto EXIT; |
goto EXIT; |
3693 |
} |
} |
3694 |
} |
} |
3695 |
} |
} |
3696 |
} |
} |
3697 |
|
|
3698 |
/* The single-character modifiers are straightforward. */ |
/* The single-character modifiers are straightforward. */ |
3699 |
|
|
3700 |
else |
else |
3701 |
{ |
{ |
3702 |
printf("** The /%c modifier is locked out - giving up.\n", *pp); |
printf("** The /%c modifier is locked out - giving up.\n", *pp); |
3703 |
yield = 1; |
yield = 1; |
3704 |
goto EXIT; |
goto EXIT; |
3705 |
} |
} |
3706 |
} |
} |
3707 |
|
|
3708 |
/* The modifier is not locked out; handle it. */ |
/* The modifier is not locked out; handle it. */ |
3709 |
|
|
3710 |
switch (*pp++) |
switch (*pp++) |
3711 |
{ |
{ |
3712 |
case 'f': options |= PCRE_FIRSTLINE; break; |
case 'f': options |= PCRE_FIRSTLINE; break; |
4572 |
while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9') |
while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9') |
4573 |
c = c * 8 + *p++ - '0'; |
c = c * 8 + *p++ - '0'; |
4574 |
break; |
break; |
4575 |
|
|
4576 |
case 'o': |
case 'o': |
4577 |
if (*p == '{') |
if (*p == '{') |
4578 |
{ |
{ |
4586 |
else c = c * 8 + *pt - '0'; |
else c = c * 8 + *pt - '0'; |
4587 |
} |
} |
4588 |
if (*pt == '}') p = pt + 1; |
if (*pt == '}') p = pt + 1; |
4589 |
else fprintf(outfile, "** Missing } after \\o{ (assumed)\n"); |
else fprintf(outfile, "** Missing } after \\o{ (assumed)\n"); |
4590 |
} |
} |
4591 |
break; |
break; |
4592 |
|
|
4593 |
case 'x': |
case 'x': |
4594 |
if (*p == '{') |
if (*p == '{') |