From e7b033d7b38bc55f934521b5f35060b43a8b0526 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 30 Nov 2016 11:47:27 +0300 Subject: Make path::normalize() to preserve ./, invalidate paths starting with \, / on Windows --- butl/path | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'butl/path') diff --git a/butl/path b/butl/path index 2a32c70..2e243ff 100644 --- a/butl/path +++ b/butl/path @@ -808,7 +808,11 @@ namespace butl // Normalize the path and return *this. Normalization involves collapsing // the '.' and '..' directories if possible, collapsing multiple // directory separators, and converting all directory separators to the - // canonical form. + // canonical form. If cur_empty is true then collapse relative paths + // representing the current directory (for example, '.', './', 'foo/..') + // to an empty path. Otherwise convert it to the canonical form (./ on + // POSIX systems). Note that a non-empty path cannot become an empty one + // in the latter case. // // If actual is true, then for case-insensitive filesystems obtain the // actual spelling of the path. Only an absolute path can be actualized. @@ -818,7 +822,7 @@ namespace butl // etc.) are returned in their actual spelling. // basic_path& - normalize (bool actual = false); + normalize (bool actual = false, bool cur_empty = false); // Make the path absolute using the current directory unless it is already // absolute. Return *this. -- cgit v1.1