Pārlūkot izejas kodu

Do not try to remove dots for now

Daniele Bartolini 8 gadi atpakaļ
vecāks
revīzija
75e0c0d565
2 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 1 1
      src/core/filesystem/path.cpp
  2. 4 4
      src/core/unit_tests.cpp

+ 1 - 1
src/core/filesystem/path.cpp

@@ -98,7 +98,7 @@ namespace path
 
 		for (; *path; ++path)
 		{
-			if (cc == PATH_SEPARATOR && (any_separator(*path) || *path == '.'))
+			if (cc == PATH_SEPARATOR && any_separator(*path))
 				continue;
 
 			cc = any_separator(*path) ? PATH_SEPARATOR : *path;

+ 4 - 4
src/core/unit_tests.cpp

@@ -1169,13 +1169,13 @@ static void test_path()
 	{
 		TempAllocator128 ta;
 		DynamicString clean(ta);
-		path::reduce(clean, "/home/./foo/");
+		path::reduce(clean, "/home//foo/");
 		ENSURE(clean == "/home/foo");
 	}
 	{
 		TempAllocator128 ta;
 		DynamicString clean(ta);
-		path::reduce(clean, "\\home\\.\\foo\\");
+		path::reduce(clean, "\\home\\\\foo\\");
 		ENSURE(clean == "/home/foo");
 	}
 #else
@@ -1210,13 +1210,13 @@ static void test_path()
 	{
 		TempAllocator128 ta;
 		DynamicString clean(ta);
-		path::reduce(clean, "C:\\Users\\.\\foo\\");
+		path::reduce(clean, "C:\\Users\\\\foo\\");
 		ENSURE(clean == "C:\\Users\\foo");
 	}
 	{
 		TempAllocator128 ta;
 		DynamicString clean(ta);
-		path::reduce(clean, "C:/Users/./foo/");
+		path::reduce(clean, "C:/Users//foo/");
 		ENSURE(clean == "C:\\Users\\foo");
 	}
 #endif // CROWN_PLATFORM_POSIX