/ Check-in [357231ec]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the zInit[] optimization of test_regexp.c when the initial string contains 3-byte UTF8 characters.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:357231ec970adb5dfcdaf9665499141004cb1198
User & Date: drh 2013-01-04 14:06:24
Context
2013-01-04
19:22
Fix an out-of-order local variable declaration in test_regexp.c. check-in: 8285b15a user: drh tags: trunk
14:06
Fix the zInit[] optimization of test_regexp.c when the initial string contains 3-byte UTF8 characters. check-in: 357231ec user: drh tags: trunk
2013-01-03
19:34
Bring back test_regexp changes that were made when porting to Fossil. Also fix some bugs that were introduced by the Fossil port. check-in: 45c158b1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_regexp.c.

648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
        pRe->zInit[j++] = x;
      }else if( x<=0xfff ){
        pRe->zInit[j++] = 0xc0 | (x>>6);
        pRe->zInit[j++] = 0x80 | (x&0x3f);
      }else if( x<=0xffff ){
        pRe->zInit[j++] = 0xd0 | (x>>12);
        pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f);
        pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f);
      }else{
        break;
      }
    }
    if( j>0 && pRe->zInit[j-1]==0 ) j--;
    pRe->nInit = j;
  }







|







648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
        pRe->zInit[j++] = x;
      }else if( x<=0xfff ){
        pRe->zInit[j++] = 0xc0 | (x>>6);
        pRe->zInit[j++] = 0x80 | (x&0x3f);
      }else if( x<=0xffff ){
        pRe->zInit[j++] = 0xd0 | (x>>12);
        pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f);
        pRe->zInit[j++] = 0x80 | (0x3f);
      }else{
        break;
      }
    }
    if( j>0 && pRe->zInit[j-1]==0 ) j--;
    pRe->nInit = j;
  }