aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-02-10 09:42:29 +1100
committernyamatongwe <devnull@localhost>2011-02-10 09:42:29 +1100
commit4c09f98c7f268fc6bb72a261cb45de24e86fdbca (patch)
tree5b925a64d6a8ec9df80f3474e3e6c7b56eb57bd5 /src
parentf51df2ca59cf06951c2cd422e593081a84bd22f7 (diff)
downloadscintilla-mirror-4c09f98c7f268fc6bb72a261cb45de24e86fdbca.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.
Diffstat (limited to 'src')
-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;