diff options
author | nyamatongwe <devnull@localhost> | 2013-05-04 17:45:47 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-05-04 17:45:47 +1000 |
commit | 7c9825172c1391a699a5275b1473e285429e22e8 (patch) | |
tree | ebf9b0f0a7a6544cecb8e112f88950fdb7a6cb8e /src/Document.cxx | |
parent | b06956e4248bd4222576d35d8827c65b09fcd9d7 (diff) | |
download | scintilla-mirror-7c9825172c1391a699a5275b1473e285429e22e8.tar.gz |
Replacing raw pointers and allocations with std::string.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 7 |
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++; |