This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: \N{...} in regular expression [PATCH]
authorYves Orton <demerphq@gmail.com>
Tue, 19 Sep 2006 20:36:17 +0000 (22:36 +0200)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Tue, 19 Sep 2006 19:09:36 +0000 (19:09 +0000)
Message-ID: <9b18b3110609191136v4d595f37pa0a52b8c20851588@mail.gmail.com>

p4raw-id: //depot/perl@28872

regcomp.c

index 4cf4775..871043e 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5021,9 +5021,9 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep)
             | PERL_SCAN_DISALLOW_PREFIX
             | (SIZE_ONLY ? PERL_SCAN_SILENT_ILLDIGIT : 0);
         UV cp;
-        len = endbrace - name - 2;
+        len = (STRLEN)(endbrace - name - 2);
         cp = grok_hex(name + 2, &len, &fl, NULL);
-        if ( len != endbrace - name - 2 ) {
+        if ( len != (STRLEN)(endbrace - name - 2) ) {
             cp = 0xFFFD;
         }    
         if (cp > 0xff)
@@ -5102,7 +5102,7 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep)
         if (len) {
             STRLEN numlen = 1;
             if ( SvUTF8(sv_str) ) {
-                *valuep = utf8_to_uvchr(p, &numlen);
+                *valuep = utf8_to_uvchr((U8*)p, &numlen);
                 if (*valuep > 0x7F)
                     RExC_utf8 = 1; 
                 /* XXXX
@@ -5162,7 +5162,7 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep)
         /* len is the length written, charlen is the size the char read */
         for ( len = 0; p < pend; p += charlen ) {
             if (UTF) {
-                UV uvc = utf8_to_uvchr(p, &charlen);
+                UV uvc = utf8_to_uvchr((U8*)p, &charlen);
                 if (FOLD) {
                     STRLEN foldlen,numlen;
                     U8 tmpbuf[UTF8_MAXBYTES_CASE+1], *foldbuf;