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

Diff of /code/trunk/pcre_compile.c

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

revision 392 by ph10, Tue Mar 17 21:30:30 2009 UTC revision 395 by ph10, Fri Mar 20 11:22:42 2009 UTC
# Line 1663  for (code = first_significant_code(code Line 1663  for (code = first_significant_code(code
1663      {      {
1664      BOOL empty_branch;      BOOL empty_branch;
1665      if (GET(code, 1) == 0) return TRUE;    /* Hit unclosed bracket */      if (GET(code, 1) == 0) return TRUE;    /* Hit unclosed bracket */
1666    
1667      /* Scan a closed bracket */      /* If a conditional group has only one branch, there is a second, implied,
1668        empty branch, so just skip over the conditional, because it could be empty.
1669      empty_branch = FALSE;      Otherwise, scan the individual branches of the group. */
1670      do  
1671        {      if (c == OP_COND && code[GET(code, 1)] != OP_ALT)
       if (!empty_branch && could_be_empty_branch(code, endcode, utf8))  
         empty_branch = TRUE;  
1672        code += GET(code, 1);        code += GET(code, 1);
1673        else
1674          {
1675          empty_branch = FALSE;
1676          do
1677            {
1678            if (!empty_branch && could_be_empty_branch(code, endcode, utf8))
1679              empty_branch = TRUE;
1680            code += GET(code, 1);
1681            }
1682          while (*code == OP_ALT);
1683          if (!empty_branch) return FALSE;   /* All branches are non-empty */
1684        }        }
1685      while (*code == OP_ALT);  
     if (!empty_branch) return FALSE;   /* All branches are non-empty */  
1686      c = *code;      c = *code;
1687      continue;      continue;
1688      }      }

Legend:
Removed from v.392  
changed lines
  Added in v.395

  ViewVC Help
Powered by ViewVC 1.1.5