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 685e15a..ca034c9 100644
--- a/libbutl/path.mxx
+++ b/libbutl/path.mxx
@@ -317,9 +317,12 @@ LIBBUTL_MODEXPORT namespace butl
// Return the position of '.' or npos if there is no extension.
//
static size_type
- find_extension (string_type const& s)
+ find_extension (string_type const& s, size_type n = string_type::npos)
{
- const C* r (find_extension (s.c_str (), s.size ()));
+ if (n == string_type::npos)
+ n = s.size ();
+
+ const C* r (find_extension (s.c_str (), n));
return r != nullptr ? r - s.c_str () : string_type::npos;
}