Skip to content

Commit

Permalink
Fixed check for 'newLinePos' when using a custom line comment prefix …
Browse files Browse the repository at this point in the history
…with other length than 2
  • Loading branch information
Cybso committed Nov 28, 2024
1 parent f5fd2dd commit 0894f47
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void setScriptToTokenize(String script)
if (i == 0 || script.charAt(i-1) == '\n') {
// Only when the comment starts on a new line
int newLinePos = script.indexOf('\n', i);
if (newLinePos > 0 && newLinePos > i+18) {
if (newLinePos > i + 16 + _lineCommentBegin.length()) {
String terminator = script.substring(i + 16 + _lineCommentBegin.length(), newLinePos).trim();
if (!terminator.isEmpty()) {
s_log.info("changing statement separator to '" + terminator + "'");
Expand Down

0 comments on commit 0894f47

Please sign in to comment.