rust/library/std
Jubilee 7aa9ce55b9
Rollup merge of #89270 - seanyoung:join_fold, r=m-ou-se
path.push() should work as expected on windows verbatim paths

On Windows, std::fs::canonicalize() returns an so-called UNC path.  UNC paths differ with regular paths because:

- This type of path can much longer than a non-UNC path (32k vs 260 characters).
- The prefix for a UNC path is ``Component::Prefix(Prefix::DiskVerbatim(..)))``
- No `/` is allowed
- No `.` is allowed
- No `..` is allowed

Rust has poor handling of such paths. If you join a UNC path with a path with any of the above, then this will not work.

I've implemented a new method `fn join_fold()` which joins paths and also removes any `.` and `..` from it, and replaces `/` with `\` on Windows. Using this function it is possible to use UNC paths without issue. In addition, this function is useful on Linux too; paths can be appended without having to call `canonicalize()` to remove the `.` and `..`.

This PR needs test cases, which can I add. I hope this will a start of a discussion.
2021-10-04 21:12:35 -07:00
..
benches
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #89270 - seanyoung:join_fold, r=m-ou-se 2021-10-04 21:12:35 -07:00
tests Update aarch64 runtime feature detection tests 2021-08-03 12:07:56 +00:00
build.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
Cargo.toml Expose the std_detect env_override feature 2021-09-25 20:30:25 +02:00