D-Programming-Language/phobos — pull request #1295 by M-frankied (2013-05-19 09:11:38+00:00)
Title: [10116] stdio.File.byLine repeats last line forever, readln(ref C[],R) r...

...eturns bad data

byLine expects readln to return with an empty buffer on end-of-stream,
which readln does not do for wchar and dchar. Also, the readln variant
that takes a terminator range returns incorrect concatenations of
lines because of the same issue. Fixed by setting buffer.length=0 in
readln for this case. Unit test updated to detect this issue.