summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index d388cbda3..24fca5174 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -71,14 +71,14 @@ 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);
+ return (s.compare(s.size() - end.size(), end.size(), end) == 0);
}
bool Startswith(const std::string &s, const std::string &start)
{
if (start.size() > s.size())
return false;
- return (s.substr(0, start.size()) == start);
+ return (s.compare(0, start.size(), start) == 0);
}
}