mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-14 02:54:16 -04:00
Fix FileName
This commit is contained in:
@ -365,6 +365,7 @@ namespace Unity_Studio
|
||||
{
|
||||
asset.Text += " #" + asset.uniqueID;
|
||||
}
|
||||
asset.Text = FixFileName(asset.Text);
|
||||
assetsFile.exportableAssets.Add(asset);
|
||||
}
|
||||
ProgressBarPerformStep();
|
||||
@ -1853,5 +1854,11 @@ namespace Unity_Studio
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string FixFileName(string str)
|
||||
{
|
||||
if (str.Length >= 260) return Path.GetRandomFileName();
|
||||
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user