diff options
author | nyamatongwe <devnull@localhost> | 2002-02-15 10:58:32 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2002-02-15 10:58:32 +0000 |
commit | 4bab5bd86c9c69c7695be85a4a1fae0018f60b50 (patch) | |
tree | 38ce2d830190fe5230e7e57c26da09475aca04ad | |
parent | d59b53b5b56d5e4632ca0b0876d902ff4a96ee63 (diff) | |
download | scintilla-mirror-4bab5bd86c9c69c7695be85a4a1fae0018f60b50.tar.gz |
Fixed out of bounds styling.
-rw-r--r-- | src/LexOthers.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index 2c3998e7b..5e3da2d0a 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -201,26 +201,30 @@ static void ColourisePropsLine( unsigned int i = 0; while (isspacechar(lineBuffer[i]) && (i < lengthLine)) // Skip initial spaces i++; - if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') { - styler.ColourTo(endPos, 1); - } else if (lineBuffer[i] == '[') { - styler.ColourTo(endPos, 2); - } else if (lineBuffer[i] == '@') { - styler.ColourTo(startLine + i, 4); - if (lineBuffer[++i] == '=') - styler.ColourTo(startLine + i, 3); - styler.ColourTo(endPos, 0); - } else { - // Search for the '=' character - while (lineBuffer[i] != '=' && (i < lengthLine - 1)) - i++; - if (lineBuffer[i] == '=') { - styler.ColourTo(startLine + i - 1, 0); - styler.ColourTo(startLine + i, 3); - styler.ColourTo(endPos-1, 0); + if (i < lengthLine) { + if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') { + styler.ColourTo(endPos, 1); + } else if (lineBuffer[i] == '[') { + styler.ColourTo(endPos, 2); + } else if (lineBuffer[i] == '@') { + styler.ColourTo(startLine + i, 4); + if (lineBuffer[++i] == '=') + styler.ColourTo(startLine + i, 3); + styler.ColourTo(endPos, 0); } else { - styler.ColourTo(endPos-1, 0); + // Search for the '=' character + while (lineBuffer[i] != '=' && (i < lengthLine - 1)) + i++; + if (lineBuffer[i] == '=') { + styler.ColourTo(startLine + i - 1, 0); + styler.ColourTo(startLine + i, 3); + styler.ColourTo(endPos-1, 0); + } else { + styler.ColourTo(endPos-1, 0); + } } + } else { + styler.ColourTo(endPos-1, 0); } } |