Skip to content

Conversation

sashaodessa
Copy link
Contributor

Fixed a bug in crates/common/src/io/stdin.rs where reading from stdin with read_line=true would leave trailing \r characters when processing CRLF line endings (Windows-style).

Problem:

  • read_bytes(true) only removed \n but left \r from CRLF sequences
  • This caused parsing failures and invisible characters in parsed values
  • Affected all stdin utilities that use unwrap_line(), parse_line(), etc.

Solution:

  • Added removal of trailing \r after \n in read_bytes(true)
  • Now properly handles both LF (\n) and CRLF (\r\n) line endings

@sashaodessa
Copy link
Contributor Author

@onbjerg how to fix it?

@onbjerg
Copy link
Contributor

onbjerg commented Sep 11, 2025

The failure is unrelated, don't worry about it :)

@mattsse mattsse merged commit b8b3cb9 into foundry-rs:master Sep 11, 2025
44 of 48 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Sep 11, 2025
MerkleBoy pushed a commit to MerkleBoy/foundry that referenced this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants