We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5484350 commit 8288be3Copy full SHA for 8288be3
1 file changed
src/uu/wc/src/wc.rs
@@ -59,9 +59,12 @@ fn try_get_stdin_size() -> Option<usize> {
59
return None;
60
};
61
62
- if rustix::fs::FileType::from_raw_mode(stat.st_mode) == rustix::fs::FileType::RegularFile {
+ let file_type = rustix::fs::FileType::from_raw_mode(stat.st_mode);
63
+
64
+ if file_type == rustix::fs::FileType::RegularFile && stat.st_size > 0 {
65
return Some(stat.st_size as usize);
66
}
67
68
None
69
70
#[cfg(not(unix))]
0 commit comments