aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-rw-r--r--butl/path.ixx9
1 files changed, 6 insertions, 3 deletions
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
}