diff options
author | Michael Vogt <mvo@debian.org> | 2013-11-29 08:38:12 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-11-29 08:38:12 +0100 |
commit | faeb435cab7b41a50c621ef9f96853d15c57d0d8 (patch) | |
tree | c2554080ab4a46b0cfdd1eba7fb0767328e75c44 /apt-pkg/contrib/strutl.cc | |
parent | c1a61d1ca91e0a0a79b8c1be3fe04bcfa12cf0dc (diff) | |
parent | cf993341c2067ee091cfd51e5da0e237babce171 (diff) |
Merge branch 'feature/edit-sources' into debian/sid
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 9f794927d..962112854 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -49,6 +49,14 @@ std::string Strip(const std::string &s) size_t end = s.find_last_not_of(" \t\n"); return s.substr(start, end-start+1); } + +bool Endswith(const std::string &s, const std::string &end) +{ + if (end.size() > s.size()) + return false; + return (s.substr(s.size() - end.size(), s.size()) == end); +} + } } /*}}}*/ |