[PATCH] D46887: Fix llvm::sys::path::remove_dots() to return "." instead of an empty path.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 15 14:10:09 PDT 2018


ruiu added a comment.

I believe this function was written based on Rob Pike's Clean() function for Go, and the Go's function also returns "." (instead of "") for the current directory. So this change makes sense to me.

https://golang.org/pkg/path/#example_Clean

Maybe you should return "." for "". as well. An empty string as a path component makes sense, as "/foo/bar", "/foo//bar" and "/foo/./bar" are all interpreted as the same path. Go's Clean() returns "." for "" too.


https://reviews.llvm.org/D46887





More information about the llvm-commits mailing list