提交 5228dc67 编写于 作者: A Adam Barth

sky_snapshot should work with absolute paths

Instead of appending the first path component, we should use it to initialize
`result`. That makes this code work with absolute paths.
上级 8af8d68b
......@@ -25,8 +25,10 @@ std::string Fetch(const std::string& url) {
base::FilePath SimplifyPath(const base::FilePath& path) {
std::vector<base::FilePath::StringType> components;
path.GetComponents(&components);
base::FilePath result;
for (const auto& component : components) {
auto it = components.begin();
base::FilePath result(*it++);
for (; it != components.end(); it++) {
auto& component = *it;
if (component == base::FilePath::kCurrentDirectory)
continue;
if (component == base::FilePath::kParentDirectory)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册