https://issues.dlang.org/show_bug.cgi?id=18962

Steven Schveighoffer <schvei...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schvei...@yahoo.com
         Resolution|---                         |WONTFIX

--- Comment #1 from Steven Schveighoffer <schvei...@yahoo.com> ---
This is due to libc on windows attempting to fix the line endings for you.
There's not much D can do about it, since it relies on FILE * to do its i/o.

Note that the reason the single readln affects things is likely because
line-endings are altered when the buffer is filled (which is done with one
large read). All future reads can't recover the removed CRs.

If you want the given behavior, set the mode to binary before doing anything:

_setmode(stdin.fileno, _O_BINARY);

The reason it doesn't occur on Linux is because Linux doesn't do anything in
binary mode.

--

Reply via email to