/[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 322 by ph10, Wed Mar 5 17:14:08 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    // This is for ABI compatibility with old versions of pcre (pre-7.6),
61    // which defined a global no_arg variable instead of putting it in the
62    // RE class.  This works on GCC >= 3, at least.  We could probably have
63    // a more inclusive test if we ever needed it.
64    #if defined(__GNUC__) && __GNUC__ >= 3
65    extern Arg no_arg __attribute__((alias("_ZN7pcrecpp2RE6no_argE")));
66    #endif
67    
68  // If a regular expression has no error, its error_ field points here  // If a regular expression has no error, its error_ field points here
69  static const string empty_string;  static const string empty_string;
# Line 369  int RE::GlobalReplace(const StringPiece& Line 377  int RE::GlobalReplace(const StringPiece&
377    int start = 0;    int start = 0;
378    int lastend = -1;    int lastend = -1;
379    
380    for (; start <= static_cast<int>(str->length()); count++) {    while (start <= static_cast<int>(str->length())) {
381      int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize);      int matches = TryMatch(*str, start, UNANCHORED, vec, kVecSize);
382      if (matches <= 0)      if (matches <= 0)
383        break;        break;
# Line 409  int RE::GlobalReplace(const StringPiece& Line 417  int RE::GlobalReplace(const StringPiece&
417        Rewrite(&out, rewrite, *str, vec, matches);        Rewrite(&out, rewrite, *str, vec, matches);
418        start = matchend;        start = matchend;
419        lastend = matchend;        lastend = matchend;
420        // count++;  // Removed by PH 19-Dec-2007: duplicate count increment        count++;
421      }      }
422    }    }
423    

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

  ViewVC Help
Powered by ViewVC 1.1.5