aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-03-02 12:13:11 +0000
committernyamatongwe <devnull@localhost>2009-03-02 12:13:11 +0000
commit62dbb73c69ee1faa53c4020bae003527f8afa7c1 (patch)
tree66de1441fdba551e26fd6e3c7c5988a4f464c08a
parent5ddeca87f39167de96aa2a566811c4e38a6c9f36 (diff)
downloadscintilla-mirror-62dbb73c69ee1faa53c4020bae003527f8afa7c1.tar.gz
Bug #2635257 Shell HERE (redirect stdin) end not detected in Bash Lexer
fixed.
-rw-r--r--src/LexBash.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/LexBash.cxx b/src/LexBash.cxx
index 7b475a7de..5801278be 100644
--- a/src/LexBash.cxx
+++ b/src/LexBash.cxx
@@ -334,6 +334,10 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
}
char s[HERE_DELIM_MAX];
sc.GetCurrent(s, sizeof(s));
+ if (sc.LengthCurrent() == 0)
+ break;
+ if (s[strlen(s) - 1] == '\r')
+ s[strlen(s) - 1] = '\0';
if (strcmp(HereDoc.Delimiter, s) == 0) {
if ((prefixws > 0 && HereDoc.Indent) || // indentation rule
(prefixws == 0 && !HereDoc.Indent)) {