mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
fixed #6362: Parse path correctly when path only contains root
This commit is contained in:
parent
02b42be2fb
commit
4aa373b94e
1 changed files with 3 additions and 3 deletions
|
@ -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 "";
|
||||
|
|
Loading…
Reference in a new issue