Skip to content

Commit

Permalink
fixed issue with hanging on non std (file) input
Browse files Browse the repository at this point in the history
  • Loading branch information
QpxDesign committed May 20, 2024
1 parent ebe8ff3 commit a0d7e01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] }
[package]
name = "ngxav"
version = "0.6.1"
version = "0.6.2"
edition = "2021"
license = "MIT"
description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries"
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use atty::Stream;
use clap::Parser;
use rayon::prelude::*;
use std::collections::HashMap;
use std::iter::FromIterator;
use std::io::IsTerminal;

use utils::keep_line::keep_line;
use utils::parse_nginx_time_format::parse_nginx_time_format;
use utils::read_folder::read_folder;
Expand Down Expand Up @@ -32,6 +33,10 @@ fn read_line_by_line(filename: impl AsRef<Path>) -> io::Result<io::Lines<io::Buf

fn load_stdin() -> Vec<String> {
let stdin = io::stdin();
if std::io::stdin().is_terminal() {
return Vec::new();
}

return stdin
.lock()
.lines()
Expand Down

0 comments on commit a0d7e01

Please sign in to comment.