Make string_ends_with() allow long suffixes

Make string_ends_with() allow suffixes that are as long as the string we are
looking at.

	* src/abg-tools-utils.cc (string_ends_with): Allow suffixes of the
	same size as the input string.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-09-15 11:02:55 +02:00
parent e15a2d9e83
commit 5bff31d2d1
3 changed files with 1 additions and 1 deletions

View File

@ -324,7 +324,7 @@ check_file(const string& path,
bool bool
string_ends_with(const string& str, const string& suffix) string_ends_with(const string& str, const string& suffix)
{ {
if (str.length() <= suffix.length()) if (str.length() < suffix.length())
return false; return false;
return str.compare(str.length() - suffix.length(), return str.compare(str.length() - suffix.length(),
suffix.length(), suffix.length(),