mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
committed by
Craig Robbins
parent
59f84ca0a0
commit
f522e7351a
@@ -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 == "");
|
||||
|
Reference in New Issue
Block a user