diff options
author | nyamatongwe <devnull@localhost> | 2000-04-28 12:55:31 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-04-28 12:55:31 +0000 |
commit | ae0441f1cef390fdf97d04b4aeeb8e9be3d9eae7 (patch) | |
tree | ba0128e8f7199d3af278ecead35f1708bb9baf41 | |
parent | 852c901f3508bc2c7e1a5200de1ea7a13434251f (diff) | |
download | scintilla-mirror-ae0441f1cef390fdf97d04b4aeeb8e9be3d9eae7.tar.gz |
Fixed unterminated string when using \n line terminators.
-rw-r--r-- | src/LexCPP.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index ea62091df..4f042bd61 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -179,10 +179,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo state = SCE_C_DEFAULT; } } else if (state == SCE_C_STRING) { - if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { - styler.ColourTo(i-1, SCE_C_STRINGEOL); - state = SCE_C_STRINGEOL; - } else if (ch == '\\') { + if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; @@ -194,7 +191,10 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); - } + } else if (chNext == '\r' || chNext == '\n') { + styler.ColourTo(i-1, SCE_C_STRINGEOL); + state = SCE_C_STRINGEOL; + } } else if (state == SCE_C_CHARACTER) { if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { styler.ColourTo(i-1, SCE_C_STRINGEOL); |