aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regex.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c
index dd3f2b3cd67..164eb4612ae 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -5444,7 +5444,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
5444 case charset: 5444 case charset:
5445 case charset_not: 5445 case charset_not:
5446 { 5446 {
5447 register unsigned int c; 5447 register unsigned int c, corig;
5448 boolean not = (re_opcode_t) *(p - 1) == charset_not; 5448 boolean not = (re_opcode_t) *(p - 1) == charset_not;
5449 int len; 5449 int len;
5450 5450
@@ -5473,7 +5473,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
5473 } 5473 }
5474 5474
5475 PREFETCH (); 5475 PREFETCH ();
5476 c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte); 5476 corig = c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte);
5477 if (target_multibyte) 5477 if (target_multibyte)
5478 { 5478 {
5479 int c1; 5479 int c1;
@@ -5517,11 +5517,17 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
5517 { 5517 {
5518 int class_bits = CHARSET_RANGE_TABLE_BITS (&p[-1]); 5518 int class_bits = CHARSET_RANGE_TABLE_BITS (&p[-1]);
5519 5519
5520 if ( (class_bits & BIT_LOWER && ISLOWER (c)) 5520 if ( (class_bits & BIT_LOWER
5521 && (ISLOWER (c)
5522 || (corig != c
5523 && c == upcase (corig) && ISUPPER(c))))
5521 | (class_bits & BIT_MULTIBYTE) 5524 | (class_bits & BIT_MULTIBYTE)
5522 | (class_bits & BIT_PUNCT && ISPUNCT (c)) 5525 | (class_bits & BIT_PUNCT && ISPUNCT (c))
5523 | (class_bits & BIT_SPACE && ISSPACE (c)) 5526 | (class_bits & BIT_SPACE && ISSPACE (c))
5524 | (class_bits & BIT_UPPER && ISUPPER (c)) 5527 | (class_bits & BIT_UPPER
5528 && (ISUPPER (c)
5529 || (corig != c
5530 && c == downcase (corig) && ISLOWER (c))))
5525 | (class_bits & BIT_WORD && ISWORD (c)) 5531 | (class_bits & BIT_WORD && ISWORD (c))
5526 | (class_bits & BIT_ALPHA && ISALPHA (c)) 5532 | (class_bits & BIT_ALPHA && ISALPHA (c))
5527 | (class_bits & BIT_ALNUM && ISALNUM (c)) 5533 | (class_bits & BIT_ALNUM && ISALNUM (c))