From a345a24df9e40e0ba2bf1b35a5a98420b4cc255d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2016 15:15:18 +0200 Subject: Make process_path effective path always absolute --- butl/path | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'butl/path') diff --git a/butl/path b/butl/path index e6c9166..d60938f 100644 --- a/butl/path +++ b/butl/path @@ -108,10 +108,16 @@ namespace butl static bool absolute (const string_type& s) { + return absolute (s.c_str (), s.size ()); + } + + static bool + absolute (const C* s, size_type n) + { #ifdef _WIN32 - return s.size () > 1 && s[1] == ':'; + return n > 1 && s[1] == ':'; #else - return s.size () != 0 && is_separator (s[0]); + return n != 0 && is_separator (s[0]); #endif } -- cgit v1.1