Skip to content

Commit b8b3cb9

Browse files
authored
Fix CRLF line ending handling in stdin utilities (#11606)
Update stdin.rs
1 parent 116c6ac commit b8b3cb9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/common/src/io/stdin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ pub fn read_bytes(read_line: bool) -> Result<Vec<u8>> {
103103
// remove the trailing newline
104104
if let Some(b'\n') = buf.as_bytes().last() {
105105
buf.pop();
106+
if let Some(b'\r') = buf.as_bytes().last() {
107+
buf.pop();
108+
}
106109
}
107110
Ok(buf.into_bytes())
108111
} else {

0 commit comments

Comments
 (0)