/[pcre]/code/trunk/pcre_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_exec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 444 by ph10, Sun Sep 13 16:26:39 2009 UTC revision 447 by ph10, Tue Sep 15 18:17:54 2009 UTC
# Line 909  for (;;) Line 909  for (;;)
909        ecode += 1 + LINK_SIZE;        ecode += 1 + LINK_SIZE;
910        }        }
911      break;      break;
912    
913    
914        /* Before OP_ACCEPT there may be any number of OP_CLOSE opcodes,
915        to close any currently open capturing brackets. */
916    
917        case OP_CLOSE:
918        number = GET2(ecode, 1);
919        offset = number << 1;
920    
921    #ifdef DEBUG
922          printf("end bracket %d at *ACCEPT", number);
923          printf("\n");
924    #endif
925    
926        md->capture_last = number;
927        if (offset >= md->offset_max) md->offset_overflow = TRUE; else
928          {
929          md->offset_vector[offset] =
930            md->offset_vector[md->offset_end - number];
931          md->offset_vector[offset+1] = eptr - md->start_subject;
932          if (offset_top <= offset) offset_top = offset + 2;
933          }
934        ecode += 3;
935        break;
936    
937    
938      /* End of the pattern, either real or forced. If we are in a top-level      /* End of the pattern, either real or forced. If we are in a top-level
# Line 924  for (;;) Line 948  for (;;)
948        md->recursive = rec->prevrec;        md->recursive = rec->prevrec;
949        memmove(md->offset_vector, rec->offset_save,        memmove(md->offset_vector, rec->offset_save,
950          rec->saved_max * sizeof(int));          rec->saved_max * sizeof(int));
951          offset_top = rec->offset_top;
952        mstart = rec->save_start;        mstart = rec->save_start;
953        ims = original_ims;        ims = original_ims;
954        ecode = rec->after_call;        ecode = rec->after_call;
# Line 1115  for (;;) Line 1140  for (;;)
1140        memcpy(new_recursive.offset_save, md->offset_vector,        memcpy(new_recursive.offset_save, md->offset_vector,
1141              new_recursive.saved_max * sizeof(int));              new_recursive.saved_max * sizeof(int));
1142        new_recursive.save_start = mstart;        new_recursive.save_start = mstart;
1143          new_recursive.offset_top = offset_top;
1144        mstart = eptr;        mstart = eptr;
1145    
1146        /* OK, now we can do the recursion. For each top-level alternative we        /* OK, now we can do the recursion. For each top-level alternative we
# Line 1313  for (;;) Line 1339  for (;;)
1339        {        {
1340        number = GET2(prev, 1+LINK_SIZE);        number = GET2(prev, 1+LINK_SIZE);
1341        offset = number << 1;        offset = number << 1;
1342    
1343  #ifdef DEBUG  #ifdef DEBUG
1344        printf("end bracket %d", number);        printf("end bracket %d", number);
1345        printf("\n");        printf("\n");
# Line 1339  for (;;) Line 1365  for (;;)
1365          mstart = rec->save_start;          mstart = rec->save_start;
1366          memcpy(md->offset_vector, rec->offset_save,          memcpy(md->offset_vector, rec->offset_save,
1367            rec->saved_max * sizeof(int));            rec->saved_max * sizeof(int));
1368            offset_top = rec->offset_top;
1369          ecode = rec->after_call;          ecode = rec->after_call;
1370          ims = original_ims;          ims = original_ims;
1371          break;          break;
# Line 5408  if (rc == MATCH_MATCH) Line 5435  if (rc == MATCH_MATCH)
5435    too many to fit into the vector. */    too many to fit into the vector. */
5436    
5437    rc = md->offset_overflow? 0 : md->end_offset_top/2;    rc = md->offset_overflow? 0 : md->end_offset_top/2;
5438    
5439    /* If there is space, set up the whole thing as substring 0. The value of    /* If there is space, set up the whole thing as substring 0. The value of
5440    md->start_match_ptr might be modified if \K was encountered on the success    md->start_match_ptr might be modified if \K was encountered on the success
5441    matching path. */    matching path. */

Legend:
Removed from v.444  
changed lines
  Added in v.447

  ViewVC Help
Powered by ViewVC 1.1.5