From 1db88e793756f691dd5b186b470117104a659883 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 7 May 2012 13:38:39 -0700 Subject: [PATCH] Clarify docs for path::normalize. Closes #2362 --- src/libcore/path.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcore/path.rs b/src/libcore/path.rs index d722e56cdab..00a2397c000 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -200,9 +200,17 @@ fn splitext(p: path) -> (str, str) { } #[doc = " -Removes extra '.' and '..' entries from paths +Collapses redundant path separators. Does not follow symbolic links. + +# Examples + +* '/a/../b' becomes '/b' +* 'a/./b/' becomes 'a/b/' +* 'a/b/../../../' becomes '..' +* '/a/b/c/../d/./../../e/' becomes '/a/e/' + "] fn normalize(p: path) -> path { let s = split(p);