mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix RemoveRelatvePathComponents
This used to return "/foo" for "../foo" when it should return the enpty string (i.e., error removing all relative components).
This commit is contained in:
parent
59f84ca0a0
commit
f522e7351a
2 changed files with 23 additions and 17 deletions
|
@ -251,7 +251,10 @@ void TestFilePath::testRemoveRelativePathComponent()
|
|||
UASSERT(result == p("/home/user/minetest/worlds/world1"));
|
||||
path = p(".");
|
||||
result = fs::RemoveRelativePathComponents(path);
|
||||
UASSERT(result == ".");
|
||||
UASSERT(result == "");
|
||||
path = p("../a");
|
||||
result = fs::RemoveRelativePathComponents(path);
|
||||
UASSERT(result == "");
|
||||
path = p("./subdir/../..");
|
||||
result = fs::RemoveRelativePathComponents(path);
|
||||
UASSERT(result == "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue