Changeset 7223 in webkit for trunk/JavaScriptCore/kjs/regexp.cpp
- Timestamp:
- Aug 10, 2004, 2:35:09 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp.cpp
r4837 r7223 43 43 const char *errorMessage; 44 44 int errorOffset; 45 _regex = pcre_compile(p.UTF8String().c_str(), options, &errorMessage, &errorOffset, NULL); 45 UString nullTerminated(p); 46 char null(0); 47 nullTerminated.append(null); 48 _regex = pcre_compile(reinterpret_cast<const uint16_t *>(nullTerminated.data()), options, &errorMessage, &errorOffset, NULL); 46 49 if (!_regex) { 47 50 #ifndef NDEBUG … … 120 123 } 121 124 122 const CString buffer(s.UTF8String()); 123 convertUTF16OffsetsToUTF8Offsets(buffer.c_str(), &i, 1); 124 const int numMatches = pcre_exec(_regex, NULL, buffer.c_str(), buffer.size(), i, 0, offsetVector, offsetVectorSize); 125 const int numMatches = pcre_exec(_regex, NULL, reinterpret_cast<const uint16_t *>(s.data()), s.size(), i, 0, offsetVector, offsetVectorSize); 125 126 126 127 if (numMatches < 0) { … … 133 134 return UString::null(); 134 135 } 135 136 convertUTF8OffsetsToUTF16Offsets(buffer.c_str(), offsetVector, (numMatches == 0 ? 1 : numMatches) * 2);137 136 138 137 *pos = offsetVector[0];
Note:
See TracChangeset
for help on using the changeset viewer.