scolapasta-path incorrectly mutates verbatim paths on Windows #2567
Labels
A-filesystem
Area: Filesystem access and implementations.
C-bug
Category: This is a bug.
E-easy
Call for participation: Experience needed to fix: Easy / not much.
O-windows
Target: Support for building on Windows targets like `x86_64-pc-windows-msvc`.
artichoke/scolapasta-path/src/paths/windows.rs
Lines 48 to 56 in 53b84b7
This routine should check to see if the path is a "verbatim path" (also knowns as a Windows extended-length path), which means it has a prefix of
\\?\
. These paths should not be modified. The Ruby engine should treat them as opaque.See: https://users.rust-lang.org/t/understanding-windows-paths/58583.
This can be checked by using the
Path::components
iterator and checking whether the first element yielded by this iterator isComponent::Prefix
where the innerprefix_component.kind().is_verbatim()
gives true.The
Prefix
docs give these examples for the various types of paths, which we should add tests for:The linked discourse thread also includes these examples:
The text was updated successfully, but these errors were encountered: