change main parse call to use .extension (#1)

* change main parse call to use .extension

Using ends_with on arch linux (tried on both arco and manjaro distros) doesn't recognize that the path ends with .zip.
But using this (as done above as an extra check in the parse function) works.

* check if it's a file and not a dir first

since you cannot unwrap a none, which the extension from a dir is none
This commit is contained in:
2022-09-05 13:23:03 -05:00
committed by GitHub
parent ad8294cedd
commit ff8f939aed

View File

@@ -220,7 +220,7 @@ fn main() {
unsafe { PRINT_PACKETS = args.get(3).is_some(); }
let start = Instant::now();
let packet_count = if capture.ends_with(".zip") {
let packet_count = if !capture.is_dir() && capture.extension().unwrap() == "zip" {
parse(&capture, &mut cdclient)
} else {
visit_dirs(&capture, &mut cdclient, 0)