diff options
author | Tels <nospam-abuse@bloodgate.com> | 2007-09-22 16:27:29 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-09-25 08:56:40 +0000 |
commit | 0921ee73ba49a35b0e5ee887dcd21e4312b38dba (patch) | |
tree | 6f8afb1baa23de639e6857a2e64df03a04df1060 /regcomp.c | |
parent | 5c8a9ad3f4b52f54c611c43f6c8130bd98a59a91 (diff) | |
download | perl-0921ee73ba49a35b0e5ee887dcd21e4312b38dba.tar.gz |
Re: [perl #45605] Regexp failure with utf8-flagged string and byte-flagged pattern
Message-Id: <200709221427.30425@bloodgate.com>
p4raw-id: //depot/perl@31961
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1405,7 +1405,20 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs /* store the codepoint in the bitmap, and if its ascii also store its folded equivelent. */ TRIE_BITMAP_SET(trie,uvc); - if ( folder ) TRIE_BITMAP_SET(trie,folder[ uvc ]); + + /* store the folded codepoint */ + if ( folder ) TRIE_BITMAP_SET(trie,folder[ uvc ]); + + if ( !UTF ) { + /* store first byte of utf8 representation of + codepoints in the 127 < uvc < 256 range */ + if (127 < uvc && uvc < 192) { + TRIE_BITMAP_SET(trie,194); + } else if (191 < uvc ) { + TRIE_BITMAP_SET(trie,195); + /* && uvc < 256 -- we know uvc is < 256 already */ + } + } set_bit = 0; /* We've done our bit :-) */ } } else { |