Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Convert Path.GetFullPath(..) return values to Unix-style separators #91

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions RuntimeInternals/SceneManagerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,23 @@ internal static string GetAbsolutePath(string relativePath, string callerFilePat
var assetsIndexOf = absolutePath.IndexOf("Assets", StringComparison.Ordinal);
if (assetsIndexOf > 0)
{
return absolutePath.Substring(assetsIndexOf);
return ConvertToUnixPathSeparator(absolutePath.Substring(assetsIndexOf));
}

var packageIndexOf = absolutePath.IndexOf("Packages", StringComparison.Ordinal);
if (packageIndexOf > 0)
{
return absolutePath.Substring(packageIndexOf);
return ConvertToUnixPathSeparator(absolutePath.Substring(packageIndexOf));
}

Debug.LogError($"Can not resolve absolute path. relative: {relativePath}, caller: {callerFilePath}");
return null;
// Note: Do not use Exception (and Assert). Because freezes async tests on UTF v1.3.4, See UUM-25085.

static string ConvertToUnixPathSeparator(string path)
{
return path.Replace('\\', '/'); // Normalize path separator
}
}

private static bool ValidatePath(string path)
Expand Down