Fossil

Check-in [46af6b82]
Login

Check-in [46af6b82]

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

Overview
Comment:Fixed 2 string pointer type warnings reported on the mailing list.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 46af6b826085024396d254f1919de556c0d68711
User & Date: stephan 2013-01-02 12:19:49
Context
2013-01-03
09:27
Patched re_space_char() to conform to its docs (now recognizes \r as a space). ... (check-in: c77995e6 user: stephan tags: trunk)
2013-01-02
12:19
Fixed 2 string pointer type warnings reported on the mailing list. ... (check-in: 46af6b82 user: stephan tags: trunk)
11:39
s/re_exec\b/re_execute/g, for compatibility with BSD. ... (check-in: 6a26eb34 user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/regexp.c.

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
  int c = RE_EOF+1;
  int cPrev = 0;
  int rc = 0;
  ReInput in;

  in.z = zIn;
  in.i = 0;
  in.mx = nIn>=0 ? nIn : strlen(zIn);
  if( pRe->nInit ){
    unsigned char x = pRe->zInit[0];
    while( in.i+pRe->nInit<in.mx 
        && (zIn[in.i]!=x || memcmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
    ){
      in.i++;
    }







|







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
  int c = RE_EOF+1;
  int cPrev = 0;
  int rc = 0;
  ReInput in;

  in.z = zIn;
  in.i = 0;
  in.mx = nIn>=0 ? nIn : strlen((char const*)zIn);
  if( pRe->nInit ){
    unsigned char x = pRe->zInit[0];
    while( in.i+pRe->nInit<in.mx 
        && (zIn[in.i]!=x || memcmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
    ){
      in.i++;
    }
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
  if( zIn[0]=='^' ){
    zIn++;
  }else{
    re_append(pRe, RE_OP_ANYSTAR, 0);
  }
  pRe->sIn.z = (unsigned char*)zIn;
  pRe->sIn.i = 0;
  pRe->sIn.mx = strlen(pRe->sIn.z);
  zErr = re_subcompile_re(pRe);
  if( zErr ){
    re_free(pRe);
    return zErr;
  }
  if( rePeek(pRe)=='$' && pRe->sIn.i+1==pRe->sIn.mx ){
    re_append(pRe, RE_OP_MATCH, RE_EOF);







|







624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
  if( zIn[0]=='^' ){
    zIn++;
  }else{
    re_append(pRe, RE_OP_ANYSTAR, 0);
  }
  pRe->sIn.z = (unsigned char*)zIn;
  pRe->sIn.i = 0;
  pRe->sIn.mx = strlen(zIn);
  zErr = re_subcompile_re(pRe);
  if( zErr ){
    re_free(pRe);
    return zErr;
  }
  if( rePeek(pRe)=='$' && pRe->sIn.i+1==pRe->sIn.mx ){
    re_append(pRe, RE_OP_MATCH, RE_EOF);