Fix VString::endsWith when suffix is longer than input string.
This commit is contained in:
parent
ed93a111c2
commit
65290afe0a
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue