Fossil SCM

Bring the regexp.c module into alignment with the similar code in the SQLite test suite.

drh 2013-01-18 12:36 trunk
Commit 2f10a050c694431d0c87eca28b6b7a4751836cc6
1 file changed +7 -7
+7 -7
--- src/regexp.c
+++ src/regexp.c
@@ -172,11 +172,11 @@
172172
return (c>='0' && c<='9');
173173
}
174174
175175
/* Return true if c is a perl "space" character: [ \t\r\n\v\f] */
176176
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';
178178
}
179179
180180
/* Run a compiled regular expression on the zero-terminated input
181181
** string zIn[]. Return true on a match and false if there is no match.
182182
*/
@@ -401,17 +401,17 @@
401401
){
402402
p->sIn.i += 5;
403403
return v;
404404
}
405405
}
406
- if( c=='x' ){
406
+ if( c=='x' && p->sIn.i+2<p->sIn.mx ){
407407
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;
413413
}
414414
}
415415
for(i=0; zEsc[i] && zEsc[i]!=c; i++){}
416416
if( zEsc[i] ){
417417
if( i<6 ) c = zTrans[i];
418418
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button