aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/path.mxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbutl/path.mxx b/libbutl/path.mxx
index ca034c9..4f3a028 100644
--- a/libbutl/path.mxx
+++ b/libbutl/path.mxx
@@ -386,9 +386,12 @@ LIBBUTL_MODEXPORT namespace butl
}
static int
- compare (string_type const& l, string_type const& r)
+ compare (string_type const& l,
+ string_type const& r,
+ size_type n = string_type::npos)
{
- return compare (l.c_str (), l.size (), r.c_str (), r.size ());
+ return compare (l.c_str (), n < l.size () ? n : l.size (),
+ r.c_str (), n < r.size () ? n : r.size ());
}
// @@ Currently for case-insensitive filesystems (Windows) compare()