aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-05-04 17:45:47 +1000
committernyamatongwe <devnull@localhost>2013-05-04 17:45:47 +1000
commit7c9825172c1391a699a5275b1473e285429e22e8 (patch)
treeebf9b0f0a7a6544cecb8e112f88950fdb7a6cb8e /src/Document.cxx
parentb06956e4248bd4222576d35d8827c65b09fcd9d7 (diff)
downloadscintilla-mirror-7c9825172c1391a699a5275b1473e285429e22e8.tar.gz
Replacing raw pointers and allocations with std::string.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index d5a677499..c290c9226 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2227,15 +2227,14 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s
const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, int *length) {
substituted.clear();
DocumentIndexer di(doc, doc->Length());
- if (!search.GrabMatches(di))
- return 0;
+ search.GrabMatches(di);
for (int j = 0; j < *length; j++) {
if (text[j] == '\\') {
if (text[j + 1] >= '0' && text[j + 1] <= '9') {
unsigned int patNum = text[j + 1] - '0';
unsigned int len = search.eopat[patNum] - search.bopat[patNum];
- if (search.pat[patNum]) // Will be null if try for a match that did not occur
- substituted.append(search.pat[patNum], len);
+ if (!search.pat[patNum].empty()) // Will be null if try for a match that did not occur
+ substituted.append(search.pat[patNum].c_str(), len);
j++;
} else {
j++;