fixed #6362: Parse path correctly when path only contains root

This commit is contained in:
Jaex 2022-07-12 12:42:48 +03:00
parent 02b42be2fb
commit 4aa373b94e

View file

@ -192,11 +192,11 @@ public static string GetAbsolutePath(string path)
public static string GetPathRoot(string path)
{
int separator = path.IndexOf(Path.DirectorySeparatorChar);
int separator = path.IndexOf(":\\");
if (separator > 1 && path[separator - 1] == ':')
if (separator > 0)
{
return path.Remove(separator + 1);
return path.Substring(0, separator + 2);
}
return "";