From 1fce6c80566405009fe5a73eaf0cba1f8e7b6778 Mon Sep 17 00:00:00 2001 From: Nick Barry Date: Wed, 11 Jul 2018 05:11:49 -0400 Subject: fix problem with some unicode starting filenames (#8) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 4 ++-- "test/\360\237\215\213.txt" | 0 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 "test/\360\237\215\213.txt" diff --git a/Cargo.lock b/Cargo.lock index e542844..7d039f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ dependencies = [ [[package]] name = "dutree" -version = "0.2.8" +version = "0.2.9" dependencies = [ "getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index b7a5532..0b95f55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dutree" -version = "0.2.8" +version = "0.2.9" authors = ["nacho "] description = "Command line tool to analyze disk usage" repository = "https://github.com/nachoparker/dutree" diff --git a/src/lib.rs b/src/lib.rs index ff83244..554ae1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,7 @@ use std::os::unix::fs::MetadataExt; use std::env; use std::collections::HashMap; -const VERSTR : &str = "v0.2.8"; +const VERSTR : &str = "v0.2.9"; const DEF_WIDTH : u16 = 80; pub enum XResult { @@ -274,7 +274,7 @@ impl<'a> Entry<'a> { // argument filters if cfg.exclude.iter().any( |p| entry_name == p ){ continue } - if cfg.hiddn_flag && &entry_name[..1] == "." { continue } + if cfg.hiddn_flag && entry_name.starts_with("."){ continue } if cfg.no_dir_flg && path.is_dir() { continue } let entry = Entry::new( &path.as_path(), cfg, depth ); diff --git "a/test/\360\237\215\213.txt" "b/test/\360\237\215\213.txt" new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3