From a4b49e376b6ccac63c84ccb15530c13d3452fecd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 Jun 2016 15:23:58 +0300 Subject: Fix bug in basic_path::sub(), sup() --- butl/path.ixx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'butl/path.ixx') diff --git a/butl/path.ixx b/butl/path.ixx index f933bd3..c2047eb 100644 --- a/butl/path.ixx +++ b/butl/path.ixx @@ -87,7 +87,8 @@ namespace butl // The second condition guards against the /foo-bar vs /foo case. // - return m >= n && this->path_.compare (0, n, p.path_) == 0 && + return m >= n && + traits::compare (this->path_.c_str (), n, p.path_.c_str (), n) == 0 && (traits::is_separator (p.path_.back ()) || // p ends with a separator m == n || // *this == p traits::is_separator (this->path_[n])); // next char is a separator @@ -106,8 +107,10 @@ namespace butl // The second condition guards against the /foo-bar vs bar case. // - return m >= n && this->path_.compare (m - n, n, p.path_) == 0 && - (m == n || // *this == p + return m >= n && + traits::compare ( + this->path_.c_str () + m - n, n, p.path_.c_str (), n) == 0 && + (m == n || // *this == p traits::is_separator (this->path_[m - n - 1])); // prev char separator } -- cgit v1.1