From 5a59ad90dfd0f1158dbbbb836bf84741d002c50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohwiller?= Date: Wed, 25 Dec 2024 20:39:41 +0100 Subject: [PATCH] m-m-m/base#8: bugfix --- .../java/io/github/mmm/scanner/AbstractCharStreamScanner.java | 2 +- .../main/java/io/github/mmm/scanner/CharSequenceScanner.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/io/github/mmm/scanner/AbstractCharStreamScanner.java b/core/src/main/java/io/github/mmm/scanner/AbstractCharStreamScanner.java index 75fe784..497f298 100644 --- a/core/src/main/java/io/github/mmm/scanner/AbstractCharStreamScanner.java +++ b/core/src/main/java/io/github/mmm/scanner/AbstractCharStreamScanner.java @@ -433,7 +433,7 @@ public String readUntil(CharFilter filter, boolean acceptEot) { while (this.offset < this.limit) { int codePoint = this.buffer.codePointAt(this.offset); if (filter.accept(codePoint)) { - return getAppended(builder, start, this.offset - 1); + return getAppended(builder, start, this.offset); } handleCodePoint(codePoint); this.offset++; diff --git a/core/src/main/java/io/github/mmm/scanner/CharSequenceScanner.java b/core/src/main/java/io/github/mmm/scanner/CharSequenceScanner.java index e0f283f..097490b 100644 --- a/core/src/main/java/io/github/mmm/scanner/CharSequenceScanner.java +++ b/core/src/main/java/io/github/mmm/scanner/CharSequenceScanner.java @@ -292,13 +292,13 @@ public String readUntil(CharFilter filter, boolean acceptEot) { while (this.offset < this.limit) { int cp = this.buffer.codePointAt(this.offset); if (filter.accept(cp)) { - return this.buffer.substring(start, this.offset + 1); + return this.buffer.substring(start, this.offset); } handleCodePoint(cp); this.offset++; } if (acceptEot) { - if (start > this.offset) { + if (this.offset > start) { return this.buffer.substring(start, this.offset); } else { return "";