Skip to content

Commit 88c72b8

Browse files
hanbingssylvestre
authored andcommitted
Fix -ok and -okdir result inversion.
1 parent 36da0af commit 88c72b8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/find/matchers/exec.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::error::Error;
88
use std::ffi::OsString;
9-
use std::io::{stderr, stdin, Write};
9+
use std::io::{stderr, stdin, stdout, Write};
1010
use std::path::Path;
1111
use std::process::Command;
1212
use walkdir::DirEntry;
@@ -74,12 +74,13 @@ impl Matcher for SingleExecMatcher {
7474
self.executable,
7575
path_to_file.to_string_lossy()
7676
);
77-
print!("{}", tips);
77+
write!(stdout(), "{}", tips).unwrap();
78+
stdout().flush().unwrap();
7879

7980
let mut input = String::new();
8081
let _result = stdin().read_line(&mut input).unwrap();
81-
if input.trim().eq("n") {
82-
return true;
82+
if !input.trim().contains("y") {
83+
return false;
8384
}
8485
}
8586

0 commit comments

Comments
 (0)