/[pcre]/code/trunk/pcrecpp.cc
ViewVC logotype

Diff of /code/trunk/pcrecpp.cc

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

revision 288 by ph10, Wed Dec 19 12:21:45 2007 UTC revision 308 by ph10, Mon Jan 21 14:57:19 2008 UTC
# Line 55  static const int kMaxArgs = 16; Line 55  static const int kMaxArgs = 16;
55  static const int kVecSize = (1 + kMaxArgs) * 3;  // results + PCRE workspace  static const int kVecSize = (1 + kMaxArgs) * 3;  // results + PCRE workspace
56    
57  // Special object that stands-in for no argument  // Special object that stands-in for no argument
58  PCRECPP_EXP_DEFN Arg no_arg((void*)NULL);  Arg RE::no_arg((void*)NULL);
59    
60  // If a regular expression has no error, its error_ field points here  // If a regular expression has no error, its error_ field points here
61  static const string empty_string;  static const string empty_string;
# Line 369  int RE::GlobalReplace(const StringPiece& Line 369  int RE::GlobalReplace(const StringPiece&
369    int start = 0;    int start = 0;
370    int lastend = -1;    int lastend = -1;
371    
372    for (; start <= static_cast<int>(str->length()); count++) {    while (start <= static_cast<int>(str->length())) {
373      int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize);      int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize);
374      if (matches <= 0)      if (matches <= 0)
375        break;        break;
# Line 409  int RE::GlobalReplace(const StringPiece& Line 409  int RE::GlobalReplace(const StringPiece&
409        Rewrite(&out, rewrite, *str, vec, matches);        Rewrite(&out, rewrite, *str, vec, matches);
410        start = matchend;        start = matchend;
411        lastend = matchend;        lastend = matchend;
412        // count++;  // Removed by PH 19-Dec-2007: duplicate count increment        count++;
413      }      }
414    }    }
415    

Legend:
Removed from v.288  
changed lines
  Added in v.308

  ViewVC Help
Powered by ViewVC 1.1.5