aboutsummaryrefslogtreecommitdiff
path: root/butl/path
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-30 11:47:27 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-12-05 14:04:01 +0300
commite7b033d7b38bc55f934521b5f35060b43a8b0526 (patch)
tree52a99420086e7e86ac99ef4b2b96bd210504cf01 /butl/path
parentcf8f3b830789a6bcc538d2f4d0e8a1425a110c47 (diff)
Make path::normalize() to preserve ./, invalidate paths starting with \, / on Windows
Diffstat (limited to 'butl/path')
-rw-r--r--butl/path8
1 files changed, 6 insertions, 2 deletions
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.