mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix VString::endsWith when suffix is longer than input string.
This commit is contained in:
@@ -184,6 +184,7 @@ bool VString::startsWith(const string& str, const string& prefix) {
|
||||
}
|
||||
|
||||
bool VString::endsWith(const string& str, const string& suffix) {
|
||||
if (str.length() < suffix.length()) return false;
|
||||
return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user