mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
7b348ad96e
commit
339fb14402
1 changed files with 2 additions and 1 deletions
|
|
@ -118,13 +118,14 @@ impl AsyncStdin {
|
||||||
|
|
||||||
let mut buf = 0;
|
let mut buf = 0;
|
||||||
let mut bytes = 0;
|
let mut bytes = 0;
|
||||||
|
|
||||||
let success = unsafe {
|
let success = unsafe {
|
||||||
ReadFile(std::io::stdin().as_raw_handle(), &mut buf, 1, &mut bytes, std::ptr::null_mut())
|
ReadFile(std::io::stdin().as_raw_handle(), &mut buf, 1, &mut bytes, std::ptr::null_mut())
|
||||||
};
|
};
|
||||||
|
|
||||||
if success == 0 {
|
if success == 0 {
|
||||||
return Err(Error::last_os_error());
|
return Err(Error::last_os_error());
|
||||||
|
} else if bytes == 0 {
|
||||||
|
return Err(Error::new(ErrorKind::UnexpectedEof, "unexpected EOF"));
|
||||||
}
|
}
|
||||||
Ok(buf)
|
Ok(buf)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue