Skip to content
Myr

Fix too many path separators on Windows (#93).

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Matthias Reitinger · committed by David Peter · parent b441528 · Browse files · 1 file+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−1 removed

  • other:+8 added−1 removed

1 file+8 added−1 removed

modified:src/output.rs+8 added-1 removed
1 unmodified line
23use std::{fs, process};4use std::io::{self, Write};5use std::ops::Deref;6use std::path::{self, Path, PathBuf};6use std::path::{self, Path, PathBuf, Component};7#[cfg(unix)]8use std::os::unix::fs::PermissionsExt;910use ansi_term;
30 unmodified lines
41 let comp_str = component.as_os_str().to_string_lossy();4243 component_path.push(Path::new(comp_str.deref()));4445 if let Component::RootDir = component {46 // Printing the root dir would result in too many path separators on Windows.47 // Note that a root dir component won't occur on Unix, because `entry` is never an48 // absolute path in that case.49 continue;50 }5152 let metadata = component_path.metadata().ok();53 let is_directory = metadata.as_ref().map(|md| md.is_dir()).unwrap_or(false);5455 let style = if component_path
62 unmodified lines