mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #915, string ends with
This commit is contained in:
parent
93710c7489
commit
372a9e5cb3
1 changed files with 2 additions and 1 deletions
|
@ -317,7 +317,8 @@ string srs_string_remove(string str, string remove_chars)
|
||||||
|
|
||||||
bool srs_string_ends_with(string str, string flag)
|
bool srs_string_ends_with(string str, string flag)
|
||||||
{
|
{
|
||||||
return str.rfind(flag) == str.length() - flag.length();
|
ssize_t pos = str.rfind(flag);
|
||||||
|
return (pos != string::npos) && (pos == str.length() - flag.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool srs_string_ends_with(string str, string flag0, string flag1)
|
bool srs_string_ends_with(string str, string flag0, string flag1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue