We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eca7b0b commit 663cf77Copy full SHA for 663cf77
1 file changed
src/fs.rs
@@ -46,8 +46,9 @@ pub fn canonicalize_path_maybe_not_exists(
46
// When the provided path is a relative path (e.g. `foo/bar.txt`),
47
// `path.parent()` ends up being the empty string as documented in
48
// `std::path::Path::parent()` after going up the ancestor path.
49
- // In this case, we return a path concatenating the current path with
50
- // the provided path i.e. `{cwd}/foo/bar.txt`.
+ // In this case, what this function should return is a path joining
+ // the current path with the provided path i.e. `{cwd}/foo/bar.txt`,
51
+ // so we set `path` to `.` to indicate the current directory.
52
Some(parent) if parent.as_os_str().is_empty() => Path::new("."),
53
Some(parent) => parent,
54
None => return Err(err),
0 commit comments