diff options
| author | Marko Njezic <unknown> | 2011-06-08 14:59:43 +0200 | 
|---|---|---|
| committer | Marko Njezic <unknown> | 2011-06-08 14:59:43 +0200 | 
| commit | e9a1d350576ba28bab810d5de825dfb02be03ddb (patch) | |
| tree | 294c4accc8c1361778eed3892ba8dc38cd5a3be4 /src | |
| parent | 3ac9b3a53a3b0f2cd5807668d9774c0f8f3813ef (diff) | |
| download | scintilla-mirror-e9a1d350576ba28bab810d5de825dfb02be03ddb.tar.gz | |
Fix regex search on the last line of search range
when search pattern ends with escaped $ modifier. Bug #3313746.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Document.cxx | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 7b718f272..dde9c4b6b 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2113,6 +2113,7 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s  	int pos = -1;  	int lenRet = 0;  	char searchEnd = s[*length - 1]; +	char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0';  	int lineRangeBreak = lineRangeEnd + increment;  	for (int line = lineRangeStart; line != lineRangeBreak; line += increment) {  		int startOfLine = doc->LineStart(line); @@ -2124,7 +2125,7 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s  				startOfLine = startPos;  			}  			if (line == lineRangeEnd) { -				if ((endPos != endOfLine) && (searchEnd == '$')) +				if ((endPos != endOfLine) && (searchEnd == '$') && (searchEndPrev != '\\'))  					continue;	// Can't match end of line if end position before end of line  				endOfLine = endPos;  			} @@ -2135,7 +2136,7 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s  				startOfLine = endPos;  			}  			if (line == lineRangeStart) { -				if ((startPos != endOfLine) && (searchEnd == '$')) +				if ((startPos != endOfLine) && (searchEnd == '$') && (searchEndPrev != '\\'))  					continue;	// Can't match end of line if start position before end of line  				endOfLine = startPos;  			}  | 
