Skip to content

Commit fc0da82

Browse files
authored
Merge pull request #293 from erichare/fix-off-by-one
fix: Properly slice the line between backslashes
2 parents 2d7a95d + 7e05bb9 commit fc0da82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/dtsx/astra/cli/commands/db/cqlsh/CqlshStartImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private String readStdin() {
105105

106106
while ((line = reader.readLine()) != null) {
107107
if (line.trim().endsWith("\\")) {
108-
sb.append(line, 0, line.lastIndexOf('\\') - 1); // TODO this should not be -1
108+
sb.append(line.substring(0, line.lastIndexOf('\\')).stripTrailing());
109109
sb.append(NL);
110110
} else {
111111
sb.append(line);

0 commit comments

Comments
 (0)