~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

  • Committer: lbieber
  • Date: 2010-09-17 01:47:05 UTC
  • mfrom: (1770.1.2 build)
  • Revision ID: lbieber@orisndriz08-20100917014705-zzqek5l4x962z5tg
Merge Stewart - remove the unbalanced my_end() call from drizzledump
Merge Stewart - move math functions into plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
6642
6642
    /* Repeatedly replace the string with the matched regex */
6643
6643
    string subject(in_string);
6644
6644
    size_t replace_length= strlen(replace);
6645
 
    size_t length_of_replacement= strlen(replace);
6646
6645
    size_t current_position= 0;
6647
6646
    int rc= 0;
6648
 
 
6649
 
    while (true) 
 
6647
    while(0 >= (rc= pcre_exec(re, NULL, subject.c_str() + current_position, subject.length() - current_position,
 
6648
                      0, 0, ovector, 3)))
6650
6649
    {
6651
 
      rc= pcre_exec(re, NULL, subject.c_str(), subject.length(), 
6652
 
                    current_position, 0, ovector, 3);
6653
 
      if (rc < 0)
6654
 
      {
6655
 
        break;
6656
 
      }
6657
 
 
6658
6650
      current_position= static_cast<size_t>(ovector[0]);
6659
6651
      replace_length= static_cast<size_t>(ovector[1] - ovector[0]);
6660
 
      subject.replace(current_position, replace_length, replace, length_of_replacement);
6661
 
      current_position= current_position + length_of_replacement;
 
6652
      subject.replace(current_position, replace_length, replace, replace_length);
6662
6653
    }
6663
6654
 
6664
6655
    char *new_buf = (char *) malloc(subject.length() + 1);