Fossil SCM
Bring the regexp.c module into alignment with the similar code in the SQLite test suite.
Commit
2f10a050c694431d0c87eca28b6b7a4751836cc6
Parent
44dc567e57000ea…
1 file changed
+7
-7
+7
-7
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -172,11 +172,11 @@ | ||
| 172 | 172 | return (c>='0' && c<='9'); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /* Return true if c is a perl "space" character: [ \t\r\n\v\f] */ |
| 176 | 176 | static int re_space_char(int c){ |
| 177 | - return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f' ; | |
| 177 | + return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | 182 | */ |
| @@ -401,17 +401,17 @@ | ||
| 401 | 401 | ){ |
| 402 | 402 | p->sIn.i += 5; |
| 403 | 403 | return v; |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | - if( c=='x' ){ | |
| 406 | + if( c=='x' && p->sIn.i+2<p->sIn.mx ){ | |
| 407 | 407 | const unsigned char *zIn = p->sIn.z + p->sIn.i; |
| 408 | - if( p->sIn.i+2<p->sIn.mx ){ | |
| 409 | - if( re_hex(zIn[1],&v) && re_hex(zIn[2],&v) ){ | |
| 410 | - p->sIn.i += 3; | |
| 411 | - return v; | |
| 412 | - } | |
| 408 | + if( re_hex(zIn[1],&v) | |
| 409 | + && re_hex(zIn[2],&v) | |
| 410 | + ){ | |
| 411 | + p->sIn.i += 3; | |
| 412 | + return v; | |
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | for(i=0; zEsc[i] && zEsc[i]!=c; i++){} |
| 416 | 416 | if( zEsc[i] ){ |
| 417 | 417 | if( i<6 ) c = zTrans[i]; |
| 418 | 418 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -172,11 +172,11 @@ | |
| 172 | return (c>='0' && c<='9'); |
| 173 | } |
| 174 | |
| 175 | /* Return true if c is a perl "space" character: [ \t\r\n\v\f] */ |
| 176 | static int re_space_char(int c){ |
| 177 | return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f' ; |
| 178 | } |
| 179 | |
| 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | */ |
| @@ -401,17 +401,17 @@ | |
| 401 | ){ |
| 402 | p->sIn.i += 5; |
| 403 | return v; |
| 404 | } |
| 405 | } |
| 406 | if( c=='x' ){ |
| 407 | const unsigned char *zIn = p->sIn.z + p->sIn.i; |
| 408 | if( p->sIn.i+2<p->sIn.mx ){ |
| 409 | if( re_hex(zIn[1],&v) && re_hex(zIn[2],&v) ){ |
| 410 | p->sIn.i += 3; |
| 411 | return v; |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | for(i=0; zEsc[i] && zEsc[i]!=c; i++){} |
| 416 | if( zEsc[i] ){ |
| 417 | if( i<6 ) c = zTrans[i]; |
| 418 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -172,11 +172,11 @@ | |
| 172 | return (c>='0' && c<='9'); |
| 173 | } |
| 174 | |
| 175 | /* Return true if c is a perl "space" character: [ \t\r\n\v\f] */ |
| 176 | static int re_space_char(int c){ |
| 177 | return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
| 178 | } |
| 179 | |
| 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | */ |
| @@ -401,17 +401,17 @@ | |
| 401 | ){ |
| 402 | p->sIn.i += 5; |
| 403 | return v; |
| 404 | } |
| 405 | } |
| 406 | if( c=='x' && p->sIn.i+2<p->sIn.mx ){ |
| 407 | const unsigned char *zIn = p->sIn.z + p->sIn.i; |
| 408 | if( re_hex(zIn[1],&v) |
| 409 | && re_hex(zIn[2],&v) |
| 410 | ){ |
| 411 | p->sIn.i += 3; |
| 412 | return v; |
| 413 | } |
| 414 | } |
| 415 | for(i=0; zEsc[i] && zEsc[i]!=c; i++){} |
| 416 | if( zEsc[i] ){ |
| 417 | if( i<6 ) c = zTrans[i]; |
| 418 |