parent
cf45fa7f36
commit
e5b357cfb1
1 changed files with 7 additions and 2 deletions
|
@ -448,7 +448,12 @@ namespace Godot
|
||||||
// </summary>
|
// </summary>
|
||||||
public static bool IsAbsPath(this string instance)
|
public static bool IsAbsPath(this string instance)
|
||||||
{
|
{
|
||||||
return System.IO.Path.IsPathRooted(instance);
|
if (string.IsNullOrEmpty(instance))
|
||||||
|
return false;
|
||||||
|
else if (instance.Length > 1)
|
||||||
|
return instance[0] == '/' || instance[0] == '\\' || instance.Contains(":/") || instance.Contains(":\\");
|
||||||
|
else
|
||||||
|
return instance[0] == '/' || instance[0] == '\\';
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
// <summary>
|
||||||
|
@ -456,7 +461,7 @@ namespace Godot
|
||||||
// </summary>
|
// </summary>
|
||||||
public static bool IsRelPath(this string instance)
|
public static bool IsRelPath(this string instance)
|
||||||
{
|
{
|
||||||
return !System.IO.Path.IsPathRooted(instance);
|
return !IsAbsPath(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
// <summary>
|
||||||
|
|
Loading…
Reference in a new issue