From 339fb1440268d8d8e1f6dc15278497be91c6020d Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sun, 16 Feb 2025 22:14:01 +0800 Subject: [PATCH] .. --- yazi-adapter/src/stdin.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yazi-adapter/src/stdin.rs b/yazi-adapter/src/stdin.rs index fcf97a5b..3c0e262b 100644 --- a/yazi-adapter/src/stdin.rs +++ b/yazi-adapter/src/stdin.rs @@ -118,13 +118,14 @@ impl AsyncStdin { let mut buf = 0; let mut bytes = 0; - let success = unsafe { ReadFile(std::io::stdin().as_raw_handle(), &mut buf, 1, &mut bytes, std::ptr::null_mut()) }; if success == 0 { return Err(Error::last_os_error()); + } else if bytes == 0 { + return Err(Error::new(ErrorKind::UnexpectedEof, "unexpected EOF")); } Ok(buf) }