diff options
author | Nick Barry <itsnickbarry@protonmail.ch> | 2018-07-11 05:11:49 -0400 |
---|---|---|
committer | nacho <nacho.nunez@aoifes.com> | 2018-07-13 16:16:36 +0000 |
commit | 1fce6c80566405009fe5a73eaf0cba1f8e7b6778 (patch) | |
tree | 411b031da4a39b10640b25b0c39459f2d06b360f | |
parent | b047cbf8f1297a0d916b8c3365d45bf4238b45f4 (diff) |
fix problem with some unicode starting filenames (#8)v0.2.9
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/lib.rs | 4 | ||||
-rw-r--r-- | test/🍋.txt | 0 |
4 files changed, 4 insertions, 4 deletions
@@ -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)", @@ -1,6 +1,6 @@ [package] name = "dutree" -version = "0.2.8" +version = "0.2.9" authors = ["nacho <nacho@ownyourbits.com>"] description = "Command line tool to analyze disk usage" repository = "https://github.com/nachoparker/dutree" @@ -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<T,S> { @@ -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/🍋.txt b/test/🍋.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/🍋.txt |