diff options
| author | nyamatongwe <unknown> | 2013-05-04 17:45:47 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2013-05-04 17:45:47 +1000 | 
| commit | be2e93a378bd8e6f425185e80d106b26b7eb854a (patch) | |
| tree | afe2d853d57f39dff1ce7fc6e9a48a08a9d5636a /src/Document.cxx | |
| parent | 807ba474304f0fdeed7548518f5c4f22517be82b (diff) | |
| download | scintilla-mirror-be2e93a378bd8e6f425185e80d106b26b7eb854a.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++; | 
