Skip to content

Commit

Permalink
m-m-m/base#8: bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Dec 25, 2024
1 parent f1db927 commit 5a59ad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand Down

0 comments on commit 5a59ad9

Please sign in to comment.