[.NET] Fix string.PathJoin to be consistent with core
This commit is contained in:
parent
7b9c5122fa
commit
e8311840e4
1 changed files with 3 additions and 1 deletions
|
|
@ -1315,7 +1315,9 @@ namespace Godot
|
|||
/// <returns>The concatenated path with the given file name.</returns>
|
||||
public static string PathJoin(this string instance, string file)
|
||||
{
|
||||
if (instance.Length > 0 && instance[instance.Length - 1] == '/')
|
||||
if (instance.Length == 0)
|
||||
return file;
|
||||
if (instance[^1] == '/' || (file.Length > 0 && file[0] == '/'))
|
||||
return instance + file;
|
||||
return instance + "/" + file;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue