Skip to content

Commit

Permalink
fix: handle CRLF
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Jun 22, 2024
1 parent 325d599 commit fe02e81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion worker/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ async fn get_output_logged(
// EOF
Ok(0) => break,
Ok(_size) => {
// drop trailing \n
// drop trailing \n or \r\n
if buffer.ends_with(&[b'\n']) {
buffer.pop();
if buffer.ends_with(&[b'\r']) {
buffer.pop();
}
}

// convert \r to \n
Expand Down

0 comments on commit fe02e81

Please sign in to comment.