summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-10 09:31:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-10 09:31:24 +0000
commita79135933e1df731ba243e532123f9956085f1b3 (patch)
treec3bf93dbfce001e2dc4e5b964e7ab16b1ef031f8 /regexec.c
parent2d79bf7f1e821d4cc07e4959f825479a7c0ab102 (diff)
downloadperl-a79135933e1df731ba243e532123f9956085f1b3.tar.gz
[perl #23769] Unicode regex broken on simple example
regrepeat() did not work right for UTF-8(ed Latin-1) in the EXACT case, which made the \x{a0}+ fail. p4raw-id: //depot/perl@21158
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 464ceaf9e3..d2e9c66358 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4065,10 +4065,16 @@ S_regrepeat(pTHX_ regnode *p, I32 max)
case CANY:
scan = loceol;
break;
- case EXACT: /* length of string is 1 */
- c = (U8)*STRING(p);
- while (scan < loceol && UCHARAT(scan) == c)
- scan++;
+ case EXACT:
+ if (do_utf8) {
+ c = (U8)*STRING(p);
+ while (scan < loceol && utf8_to_uvuni((U8*)scan, 0) == c)
+ scan += UTF8SKIP(scan);
+ } else { /* length of string is 1 */
+ c = (U8)*STRING(p);
+ while (scan < loceol && UCHARAT(scan) == c)
+ scan++;
+ }
break;
case EXACTF: /* length of string is 1 */
c = (U8)*STRING(p);