mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
This change attempts to limit the number of allocations made when evaluating full paths. This is particularly important when Windows paths can be way over the historical max of 260 characters. (The new max is over 32K) We no longer kick paths in Windows that are valid, outside of paths with colons that are not directory separators. (This has the effect of blocking alternate data stream access- which is a legacy behavior.) When creating directories, we still drop the trailing separator, which causes trailing whitespace to be trimmed. This makes it particularly difficult to create paths with trailing spaces in .NET, which is still desirable as most code has a tough time dealing with this scenario. We'll open them fine now, which hits the above point of not kicking valid legacy paths (paths that don't require extended syntax). Several simplifications to the logic were made, including moving relative segment evaluation to shared code and calling it directly when getting directory names rather than relying on the not-so-obvious prior behavior of GetFullPath without "full checks". Commit migrated from https://github.com/dotnet/corefx/commit/11b457d1186c364bdf3e7d978006eb2417e8d060