Merge pull request #108041 from bs-mwoerner/cs_get_extension

C#: Fix return value of `StringExtensions.GetExtension()`
This commit is contained in:
Rémi Verschelde 2025-06-28 13:03:24 +02:00
commit 5aefc2eca8
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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);
}