/[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 618 by ph10, Sat Jul 16 17:24:16 2011 UTC revision 619 by ph10, Sun Jul 17 13:23:14 2011 UTC
# Line 1253  for (;;) Line 1253  for (;;)
1253        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM3);        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM3);
1254        if (rrc == MATCH_MATCH)        if (rrc == MATCH_MATCH)
1255          {          {
1256            if (md->end_offset_top > offset_top)
1257              offset_top = md->end_offset_top;  /* Captures may have happened */
1258          condition = TRUE;          condition = TRUE;
1259          ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);          ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);
1260          while (*ecode == OP_ALT) ecode += GET(ecode, 1);          while (*ecode == OP_ALT) ecode += GET(ecode, 1);
# Line 1316  for (;;) Line 1318  for (;;)
1318      break;      break;
1319    
1320    
1321      /* End of the pattern, either real or forced. If we are in a recursion, we      /* End of the pattern, either real or forced. */
     should restore the offsets appropriately, and if it's a top-level  
     recursion, continue from after the call. */  
1322    
1323        case OP_END:
1324      case OP_ACCEPT:      case OP_ACCEPT:
1325      case OP_ASSERT_ACCEPT:      case OP_ASSERT_ACCEPT:
1326      case OP_END:  
1327        /* If we have matched an empty string, fail if not in an assertion and not
1328  /*      in a recursion if either PCRE_NOTEMPTY is set, or if PCRE_NOTEMPTY_ATSTART
     if (md->recursive != NULL)  
       {  
       recursion_info *rec = md->recursive;  
   
       md->recursive = rec->prevrec;  
   
       memmove(md->offset_vector, rec->offset_save,  
         rec->saved_max * sizeof(int));  
       offset_top = rec->save_offset_top;  
       if (rec->group_num == 0)  
         {  
         ecode = rec->after_call;  
         break;  
         }  
       }  
 */  
     /* Otherwise, if we have matched an empty string, fail if not in an  
     assertion and if either PCRE_NOTEMPTY is set, or if PCRE_NOTEMPTY_ATSTART  
1329      is set and we have matched at the start of the subject. In both cases,      is set and we have matched at the start of the subject. In both cases,
1330      backtracking will then try other alternatives, if any. */      backtracking will then try other alternatives, if any. */
1331    
1332  /*    else */ if (eptr == mstart && op != OP_ASSERT_ACCEPT &&      if (eptr == mstart && op != OP_ASSERT_ACCEPT &&
   
1333           md->recursive == NULL &&           md->recursive == NULL &&
1334             (md->notempty ||
1335          (md->notempty ||             (md->notempty_atstart &&
1336            (md->notempty_atstart &&               mstart == md->start_subject + md->start_offset)))
             mstart == md->start_subject + md->start_offset)))  
1337        MRRETURN(MATCH_NOMATCH);        MRRETURN(MATCH_NOMATCH);
1338    
1339      /* Otherwise, we have a match. */      /* Otherwise, we have a match. */

Legend:
Removed from v.618  
changed lines
  Added in v.619

  ViewVC Help
Powered by ViewVC 1.1.5