Skip to content

Commit 0894f47

Browse files
committed
Fixed check for 'newLinePos' when using a custom line comment prefix with other length than 2
1 parent f5fd2dd commit 0894f47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql12/core/src/net/sourceforge/squirrel_sql/fw/sql/querytokenizer/QueryTokenizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void setScriptToTokenize(String script)
170170
if (i == 0 || script.charAt(i-1) == '\n') {
171171
// Only when the comment starts on a new line
172172
int newLinePos = script.indexOf('\n', i);
173-
if (newLinePos > 0 && newLinePos > i+18) {
173+
if (newLinePos > i + 16 + _lineCommentBegin.length()) {
174174
String terminator = script.substring(i + 16 + _lineCommentBegin.length(), newLinePos).trim();
175175
if (!terminator.isEmpty()) {
176176
s_log.info("changing statement separator to '" + terminator + "'");

0 commit comments

Comments
 (0)