@@ -3938,7 +3938,7 @@ static unsigned re_next_char(ReInput *p){
39383938 c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f);
39393939 p->i += 2;
39403940 if( c<=0x7ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd;
3941- }else if( (c&0xf8)==0xf0 && p->i+3 <p->mx && (p->z[p->i]&0xc0)==0x80
3941+ }else if( (c&0xf8)==0xf0 && p->i+2 <p->mx && (p->z[p->i]&0xc0)==0x80
39423942 && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){
39433943 c = (c&0x07)<<18 | ((p->z[p->i]&0x3f)<<12) | ((p->z[p->i+1]&0x3f)<<6)
39443944 | (p->z[p->i+2]&0x3f);
@@ -4465,15 +4465,15 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){
44654465 ** one or more matching characters, enter those matching characters into
44664466 ** zInit[]. The re_match() routine can then search ahead in the input
44674467 ** string looking for the initial match without having to run the whole
4468- ** regex engine over the string. Do not worry able trying to match
4468+ ** regex engine over the string. Do not worry about trying to match
44694469 ** unicode characters beyond plane 0 - those are very rare and this is
44704470 ** just an optimization. */
44714471 if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){
44724472 for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){
44734473 unsigned x = pRe->aArg[i];
4474- if( x<=127 ){
4474+ if( x<=0x7f ){
44754475 pRe->zInit[j++] = (unsigned char)x;
4476- }else if( x<=0xfff ){
4476+ }else if( x<=0x7ff ){
44774477 pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6));
44784478 pRe->zInit[j++] = 0x80 | (x&0x3f);
44794479 }else if( x<=0xffff ){
@@ -14637,6 +14637,7 @@ static void recoverFinalCleanup(sqlite3_recover *p){
1463714637 p->pTblList = 0;
1463814638 sqlite3_finalize(p->pGetPage);
1463914639 p->pGetPage = 0;
14640+ sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
1464014641
1464114642 {
1464214643#ifndef NDEBUG
@@ -14935,6 +14936,7 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){
1493514936 **
1493614937 ** + first freelist page (32-bits at offset 32)
1493714938 ** + size of freelist (32-bits at offset 36)
14939+ ** + the wal-mode flags (16-bits at offset 18)
1493814940 **
1493914941 ** We also try to preserve the auto-vacuum, incr-value, user-version
1494014942 ** and application-id fields - all 32 bit quantities at offsets
@@ -14998,7 +15000,8 @@ static int recoverVfsRead(sqlite3_file *pFd, void *aBuf, int nByte, i64 iOff){
1499815000 if( p->pPage1Cache ){
1499915001 p->pPage1Disk = &p->pPage1Cache[nByte];
1500015002 memcpy(p->pPage1Disk, aBuf, nByte);
15001-
15003+ aHdr[18] = a[18];
15004+ aHdr[19] = a[19];
1500215005 recoverPutU32(&aHdr[28], dbsz);
1500315006 recoverPutU32(&aHdr[56], enc);
1500415007 recoverPutU16(&aHdr[105], pgsz-nReserve);
@@ -15194,6 +15197,7 @@ static void recoverStep(sqlite3_recover *p){
1519415197 recoverOpenOutput(p);
1519515198
1519615199 /* Open transactions on both the input and output databases. */
15200+ sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
1519715201 recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
1519815202 recoverExec(p, p->dbIn, "BEGIN");
1519915203 if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
@@ -16283,7 +16287,7 @@ static int safeModeAuth(
1628316287 "zipfile",
1628416288 "zipfile_cds",
1628516289 };
16286- UNUSED_PARAMETER(zA2 );
16290+ UNUSED_PARAMETER(zA1 );
1628716291 UNUSED_PARAMETER(zA3);
1628816292 UNUSED_PARAMETER(zA4);
1628916293 switch( op ){
@@ -16298,7 +16302,7 @@ static int safeModeAuth(
1629816302 case SQLITE_FUNCTION: {
1629916303 int i;
1630016304 for(i=0; i<ArraySize(azProhibitedFunctions); i++){
16301- if( sqlite3_stricmp(zA1 , azProhibitedFunctions[i])==0 ){
16305+ if( sqlite3_stricmp(zA2 , azProhibitedFunctions[i])==0 ){
1630216306 failIfSafeMode(p, "cannot use the %s() function in safe mode",
1630316307 azProhibitedFunctions[i]);
1630416308 }
@@ -26140,7 +26144,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
2614026144 if( pVfs ){
2614126145 sqlite3_vfs_register(pVfs, 1);
2614226146 }else{
26143- utf8_printf(stderr, "no such VFS: \"%s\"\n", argv[i] );
26147+ utf8_printf(stderr, "no such VFS: \"%s\"\n", zVfs );
2614426148 exit(1);
2614526149 }
2614626150 }
0 commit comments