aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-02-10 09:42:29 +1100
committernyamatongwe <unknown>2011-02-10 09:42:29 +1100
commitf1cc26a3403508ce34c07c3975f2acb677c08e19 (patch)
tree92f6efa04fe4d5c8c1b14feed77ed8d1f3dbcce9
parent35416671e58c4ffc5b235330bcdefb86680f4d13 (diff)
downloadscintilla-mirror-f1cc26a3403508ce34c07c3975f2acb677c08e19.tar.gz
Fix for backwards case-insensitive search in code page 936. Bug #3176271.
Was not finding each occurance of a given string due to misaligned character access.
-rw-r--r--src/Document.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 91a0dda14..c0290936f 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -1309,7 +1309,11 @@ long Document::FindText(int minPos, int maxPos, const char *search,
//Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
const int limitPos = Platform::Maximum(startPos, endPos);
- int pos = forward ? startPos : (startPos - 1);
+ int pos = startPos;
+ if (!forward) {
+ // Back all of a character
+ pos = NextPosition(pos, increment);
+ }
if (caseSensitive) {
while (forward ? (pos < endSearch) : (pos >= endSearch)) {
bool found = (pos + lengthFind) <= limitPos;