Don't treat '.' in folder names as extensions.

This commit is contained in:
MineBill
2023-09-16 19:07:23 +03:00
parent 722133165b
commit 9931a5c026
2 changed files with 8 additions and 2 deletions

View File

@@ -90,6 +90,12 @@ namespace FlaxEditor.Modules
hint = "Too long name.";
return false;
}
if (item.IsFolder && shortName.EndsWith("."))
{
hint = "Name cannot end with '.'";
return false;
}
// Find invalid characters
if (Utilities.Utils.HasInvalidPathChar(shortName))
@@ -120,7 +126,7 @@ namespace FlaxEditor.Modules
// Cache data
string sourcePath = item.Path;
string sourceFolder = System.IO.Path.GetDirectoryName(sourcePath);
string extension = System.IO.Path.GetExtension(sourcePath);
string extension = item.IsFolder ? "" : System.IO.Path.GetExtension(sourcePath);
string destinationPath = StringUtils.CombinePaths(sourceFolder, shortName + extension);
if (item.IsFolder)