Skip to content

Commit

Permalink
Clarify copying remaining characters after replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelv committed Oct 8, 2024
1 parent a18e6e5 commit 91308e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/jlib/jstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ StringBuffer &replaceString(StringBuffer & result, size_t lenSource, const char
// If there were any characters left or characters that didn't match, append them
left += unmatchedChars;
if (left && (offset - left) < lenSource)
result.append(left, source + offset - unmatchedChars);
result.append(left, source + lenSource - left);
}
else
result.append(lenSource, source); // Search string is empty, just copy the source
Expand Down

0 comments on commit 91308e1

Please sign in to comment.