diff options
author | Neil <nyamatongwe@gmail.com> | 2013-10-10 23:14:29 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-10-10 23:14:29 +1100 |
commit | e44b84645510ce7cb822411af59080b464ff1f69 (patch) | |
tree | a126be26634da54e49529ab6aa8422bcc29d452e /lexers/LexPerl.cxx | |
parent | c02473005243ee0eae5e1f037dd3716248ed9299 (diff) | |
download | scintilla-mirror-e44b84645510ce7cb822411af59080b464ff1f69.tar.gz |
Bug [#1528]. Perl: POD problems with multibyte characters.
From Colomban Wendling and Kein-Hong Man.
Diffstat (limited to 'lexers/LexPerl.cxx')
-rw-r--r-- | lexers/LexPerl.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx index fe169f071..d6fa7446c 100644 --- a/lexers/LexPerl.cxx +++ b/lexers/LexPerl.cxx @@ -191,9 +191,9 @@ static int styleCheckIdentifier(LexAccessor &styler, unsigned int bk) { static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) { // forward scan the current line to classify line for POD style int state = -1; - while (pos <= endPos) { + while (pos < endPos) { int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos)); - if (ch == '\n' || ch == '\r' || pos >= endPos) { + if (ch == '\n' || ch == '\r') { if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++; break; } @@ -943,7 +943,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle, if (pod == SCE_PL_DEFAULT) { if (sc.state == SCE_PL_POD_VERB) { unsigned int fw2 = fw; - while (fw2 <= endPos && pod == SCE_PL_DEFAULT) { + while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) { fw = fw2++; // penultimate line (last blank line) pod = podLineScan(styler, fw2, endPos); styler.SetLineState(styler.GetLine(fw2), pod); @@ -965,7 +965,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle, } sc.SetState(pod); } - sc.Forward(fw - sc.currentPos); // commit style + sc.ForwardBytes(fw - sc.currentPos); // commit style } break; case SCE_PL_REGEX: |