ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FeepingCreaturism/Matcher.cpp
(Generate patch)

Comparing FeepingCreaturism/Matcher.cpp (file contents):
Revision 234 by Douglas Thrift, 2004-09-01T02:10:19-07:00 vs.
Revision 235 by Douglas Thrift, 2004-09-10T16:08:12-07:00

# Line 17 | Line 17 | bool Matcher::match(const ext::String& s
17                  pcre_fullinfo(expression, NULL, PCRE_INFO_CAPTURECOUNT, &length);
18  
19                  int* substrings(new int[(++length *= 3)]);
20 <                int count(pcre_exec(expression, NULL, stuff.c_str(), stuff.length(), 0,
21 <                        0, substrings, length));
20 >                int count(pcre_exec(expression, NULL, stuff.NullTerminate(),
21 >                        stuff.GetData().GetSize(), 0, 0, substrings, length));
22  
23                  if (count > 0)
24                  {
25 <                        char* substring(new char[stuff.length() + 1]);
25 >                        char* substring(new char[stuff.GetData().GetSize() + 1]);
26  
27                          for (int index(0); index < count; ++index)
28                          {
29 <                                pcre_copy_substring(stuff.c_str(), substrings, count, index,
30 <                                        substring, stuff.length() + 1);
29 >                                pcre_copy_substring(stuff.NullTerminate(), substrings, count,
30 >                                        index, substring, stuff.GetData().GetSize() + 1);
31  
32                                  this->substrings.push_back(substring);
33                          }
# Line 53 | Line 53 | Matcher& Matcher::operator()(const ext::
53          const char* error;
54          int offset;
55  
56 <        this->expression = pcre_compile(expression.c_str(), 0, &error, &offset,
57 <                NULL);
56 >        this->expression = pcre_compile(expression.NullTerminate(), 0, &error,
57 >                &offset, NULL);
58  
59          return *this;
60   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines