Use case insensitive folder path comparison for creating slices
Signed-off-by: srikappa-amzn <srikappa@amazon.com>
This commit is contained in:
@@ -2648,16 +2648,14 @@ namespace AzToolsFramework
|
||||
}
|
||||
else
|
||||
{
|
||||
QString cleanSaveAs(QDir::cleanPath(slicePath));
|
||||
AZ::IO::FixedMaxPath lexicallyNormalPath = AZ::IO::PathView(slicePath.toUtf8().constData()).LexicallyNormal();
|
||||
|
||||
bool isPathSafeForAssets = false;
|
||||
for (AZStd::string assetSafeFolder : assetSafeFolders)
|
||||
for (AZ::IO::Path assetSafeFolder : assetSafeFolders)
|
||||
{
|
||||
QString cleanAssetSafeFolder(QDir::cleanPath(assetSafeFolder.c_str()));
|
||||
// Compare using clean paths so slash direction does not matter.
|
||||
// Note that this comparison is case sensitive because some file systems
|
||||
// Open 3D Engine supports are case sensitive.
|
||||
if (cleanSaveAs.startsWith(cleanAssetSafeFolder))
|
||||
// Check if the slice path is relative to the safe asset directory.
|
||||
// The Path classes are being used to make this check case insensitive.
|
||||
if (lexicallyNormalPath.IsRelativeTo(assetSafeFolder))
|
||||
{
|
||||
isPathSafeForAssets = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user