You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-04 19:21:46 +00:00
[.NET] Fix string.PathJoin to be consistent with core
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user