Commit dd0a9539 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Dont report empty path, i.e. .

parent 7306847f
[package] [package]
name = "hashtoc" name = "hashtoc"
version = "0.1.2" version = "0.1.3"
authors = ["Anders Blomdell <anders.blomdell@control.lth.se>"] authors = ["Anders Blomdell <anders.blomdell@control.lth.se>"]
build = "build.rs" build = "build.rs"
links = "libhash.a,libssl" links = "libhash.a,libssl"
......
...@@ -502,6 +502,16 @@ fn dispatcher(options: clap::ArgMatches, ...@@ -502,6 +502,16 @@ fn dispatcher(options: clap::ArgMatches,
check_name(front.inode.path.as_os_str())) { check_name(front.inode.path.as_os_str())) {
continue continue
} }
let mut path = front.inode.path.as_path();
loop {
match path.strip_prefix("./") {
Ok(p) => path = p,
_ => break
}
}
if path.eq(Path::new("")) && front.kind != ' ' {
continue
}
match front.kind { match front.kind {
' ' => { ' ' => {
// Start of new path // Start of new path
...@@ -534,13 +544,6 @@ fn dispatcher(options: clap::ArgMatches, ...@@ -534,13 +544,6 @@ fn dispatcher(options: clap::ArgMatches,
Unused => (), Unused => (),
_ => unreachable!() _ => unreachable!()
} }
let mut path = front.inode.path.as_path();
loop {
match path.strip_prefix("./") {
Ok(p) => path = p,
_ => break
}
}
bprint!("{}:", front.kind); bprint!("{}:", front.kind);
bwrite!(path.as_os_str().as_bytes()); bwrite!(path.as_os_str().as_bytes());
zprintln!(); zprintln!();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment