mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Handles empty pattern strings
Skips processing when encountering an empty string slice during pattern scanning. This prevents unexpected behavior and potential errors when the pattern string contains sections that result in an empty byte string.
This commit is contained in:
@@ -24,8 +24,10 @@ namespace omath
|
||||
const std::string_view byte_str = pattern_string.substr(sting_view_start, sting_view_end);
|
||||
|
||||
if (byte_str.empty())
|
||||
{
|
||||
start = end != pattern_string.end() ? std::next(end) : end;
|
||||
continue;
|
||||
|
||||
}
|
||||
if (byte_str == "?" || byte_str == "??")
|
||||
{
|
||||
pattern.emplace_back(std::nullopt);
|
||||
|
||||
Reference in New Issue
Block a user