Skip to content

Commit

Permalink
Attempt to fix #365
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Aug 8, 2021
1 parent 92f41b8 commit a6e205a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use atty::Stream;
use globset::GlobBuilder;
use lscolors::LsColors;
use regex::bytes::{RegexBuilder, RegexSetBuilder};
use normpath::PathExt;

use crate::error::print_error;
use crate::exec::CommandTemplate;
Expand Down Expand Up @@ -120,7 +121,7 @@ fn run() -> Result<ExitCode> {
.iter()
.map(|path_buffer| {
path_buffer
.canonicalize()
.normalize()
.and_then(|pb| filesystem::absolute_path(pb.as_path()))
.unwrap()
})
Expand Down
4 changes: 3 additions & 1 deletion tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::io::Write;
use std::path::Path;
use std::time::{Duration, SystemTime};

use normpath::PathExt;
use regex::escape;

use crate::testenv::TestEnv;
Expand All @@ -26,8 +27,9 @@ static DEFAULT_FILES: &[&str] = &[
fn get_absolute_root_path(env: &TestEnv) -> String {
let path = env
.test_root()
.canonicalize()
.normalize()
.expect("absolute path")
.as_path()
.to_str()
.expect("string")
.to_string();
Expand Down

0 comments on commit a6e205a

Please sign in to comment.