Skip to content

Commit

Permalink
Fix infinite loop on coloring $() in Makefile lexer, issue #302.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Mar 25, 2021
1 parent 40fb08f commit cfc8faf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scintilla/lexers/LexMakefile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ static void ColouriseMakeDoc(Sci_PositionU startPos, Sci_Position length, int in
state = SCE_MAKE_COMMENT;
} else if ((ch == '$' && chNext == '(') || (ch == '$' && chNext == '$' && styler.SafeGetCharAt(i + 2) == '(')) {
styler.ColourTo(i - 1, state);
Sci_Position pos = i + 1;
Sci_PositionU pos = i + 1;
if (chNext == '$') ++pos;
ch = chNext;
while (ch != ')') {
while (pos < endPos && ch != ')') {
chNext = styler.SafeGetCharAt(pos + 1);
if (ch == '$' && chNext == '(')
break;
Expand Down

0 comments on commit cfc8faf

Please sign in to comment.