mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-14 11:45:46 -07:00
Be more conservative with stdin.
If no paths are given to ripgrep, only read from stdin if it's a file or a FIFO. In particular, if something like `rg foo < /dev/null` is used, then don't try to read from stdin. Fixes #35, #81
This commit is contained in:
@@ -279,7 +279,8 @@ impl RawArgs {
|
||||
if self.arg_path.is_empty() {
|
||||
if atty::on_stdin()
|
||||
|| self.flag_files
|
||||
|| self.flag_type_list {
|
||||
|| self.flag_type_list
|
||||
|| !atty::stdin_is_readable() {
|
||||
vec![Path::new("./").to_path_buf()]
|
||||
} else {
|
||||
vec![Path::new("-").to_path_buf()]
|
||||
|
Reference in New Issue
Block a user