mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpiutil] StringExtras: Add substr() (#3742)
Unlike std::string and std::string_view, this substr() allows a start greater than the length of the string, in which case an empty string is returned. This matches llvm::StringRef behavior.
This commit is contained in:
@@ -232,7 +232,7 @@ bool FindMultipartBoundary(raw_istream& is, std::string_view boundary,
|
||||
|
||||
// Did we find the boundary?
|
||||
if (searchBuf[0] == '-' && searchBuf[1] == '-' &&
|
||||
searchBuf.substr(2) == boundary) {
|
||||
wpi::substr(searchBuf, 2) == boundary) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user