Merge pull request #108041 from bs-mwoerner/cs_get_extension
C#: Fix return value of `StringExtensions.GetExtension()`
This commit is contained in:
@@ -430,8 +430,8 @@ namespace Godot
|
||||
{
|
||||
int pos = instance.RFind(".");
|
||||
|
||||
if (pos < 0)
|
||||
return instance;
|
||||
if (pos < 0 || pos < Math.Max(instance.RFind("/"), instance.RFind("\\")))
|
||||
return string.Empty;
|
||||
|
||||
return instance.Substring(pos + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user