diff --git a/library/std/src/sys/windows/path.rs b/library/std/src/sys/windows/path.rs index d9684f2175313..eb1f42e1193d2 100644 --- a/library/std/src/sys/windows/path.rs +++ b/library/std/src/sys/windows/path.rs @@ -214,6 +214,10 @@ fn parse_next_component(path: &OsStr, verbatim: bool) -> (&OsStr, &OsStr) { /// /// This path may or may not have a verbatim prefix. pub(crate) fn maybe_verbatim(path: &Path) -> io::Result> { + if !super::compat::is_windows_nt() { + return to_u16s(path); + } + let path = to_u16s(path)?; get_long_path(path, true) }