summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 630b130c88..7f60a914f0 100644
--- a/regexec.c
+++ b/regexec.c
@@ -825,7 +825,11 @@ char *prog;
sayNO;
nextchar = UCHARAT(++locinput);
break;
+ case REFFL:
+ regtainted = TRUE;
+ /* FALL THROUGH */
case REF:
+ case REFF:
n = ARG1(scan); /* which paren pair */
s = regstartp[n];
if (!s)
@@ -835,12 +839,19 @@ char *prog;
if (s == regendp[n])
break;
/* Inline the first character, for speed. */
- if (UCHARAT(s) != nextchar)
+ if (UCHARAT(s) != nextchar &&
+ (OP(scan) == REF ||
+ (UCHARAT(s) != ((OP(scan) == REFF
+ ? fold : fold_locale)[nextchar]))))
sayNO;
ln = regendp[n] - s;
if (locinput + ln > regeol)
sayNO;
- if (ln > 1 && memNE(s, locinput, ln))
+ if (ln > 1 && (OP(scan) == REF
+ ? memNE(s, locinput, ln)
+ : (OP(scan) == REFF
+ ? ibcmp(s, locinput, ln)
+ : ibcmp_locale(s, locinput, ln))))
sayNO;
locinput += ln;
nextchar = UCHARAT(locinput);