mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
parent
84036fa765
commit
39f479025e
2 changed files with 3 additions and 0 deletions
|
@ -317,6 +317,8 @@ std::string Path::PathTo(const Path &other) {
|
|||
return std::string();
|
||||
}
|
||||
diff = a.PathTo(b);
|
||||
} else if (path_ == "/") {
|
||||
diff = other.path_.substr(1);
|
||||
} else {
|
||||
diff = other.path_.substr(path_.size() + 1);
|
||||
}
|
||||
|
|
|
@ -607,6 +607,7 @@ static bool TestPath() {
|
|||
EXPECT_EQ_STR(Path("C:\\Yo\\Lo").GetFilename(), std::string("Lo"));
|
||||
|
||||
EXPECT_EQ_STR(Path("/a/b").PathTo(Path("/a/b/c/d/e")), std::string("c/d/e"));
|
||||
EXPECT_EQ_STR(Path("/").PathTo(Path("/home/foo/bar")), std::string("home/foo/bar"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue