From 5bff31d2d1e193107be5a7bd3ea8a769a361a0f4 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 15 Sep 2015 11:02:55 +0200 Subject: [PATCH] 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 --- src/abg-tools-utils.cc | 2 +- test21-type-suppr-0.suppr | 0 test21-type-suppr-report-0.txt | 0 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 test21-type-suppr-0.suppr delete mode 100644 test21-type-suppr-report-0.txt diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index b5a7c79d..c4783454 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -324,7 +324,7 @@ check_file(const string& path, bool string_ends_with(const string& str, const string& suffix) { - if (str.length() <= suffix.length()) + if (str.length() < suffix.length()) return false; return str.compare(str.length() - suffix.length(), suffix.length(), diff --git a/test21-type-suppr-0.suppr b/test21-type-suppr-0.suppr deleted file mode 100644 index e69de29b..00000000 diff --git a/test21-type-suppr-report-0.txt b/test21-type-suppr-report-0.txt deleted file mode 100644 index e69de29b..00000000