| author | |
| committer | |
| log | 4545be360a723a4c5b141cbefcc07ac7f17f0757 |
| tree | 9d4e5499387066e5bbddc8b127b2f9092fb21332 |
| parent | 9ef1ba9d54e560ca384c95b74067674878aea019 |
closes #8821 files changed, 5 insertions(+), 0 deletions(-)
std/io.zig+5| ... | ... | @@ -486,6 +486,11 @@ pub fn readLine(buf: []u8) !usize { |
| 486 | 486 | while (true) { |
| 487 | 487 | const byte = stream.readByte() catch return error.EndOfFile; |
| 488 | 488 | switch (byte) { |
| 489 | '\r' => { | |
| 490 | // trash the following \n | |
| 491 | _ = stream.readByte() catch return error.EndOfFile; | |
| 492 | return index; | |
| 493 | }, | |
| 489 | 494 | '\n' => return index, |
| 490 | 495 | else => { |
| 491 | 496 | if (index == buf.len) return error.InputTooLong; |