Bug 10116 – stdio.File.byLine repeats last line forever, readln(ref C[],R) returns bad data

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-19T02:06:00Z
Last change time
2013-05-20T00:53:41Z
Assigned to
nobody
Creator
fw..vdijk

Comments

Comment #0 by fw..vdijk — 2013-05-19T02:06:01Z
byLine expects readln to return with an empty buffer on end-of-stream, which readln does not do for wchar and dchar, so byLine!(x,wchar) and byLine!(x,dchar) repeat forever. Also, the readln variant that takes a terminator range returns incorrect concatenations of lines because of the same issue.
Comment #1 by fw..vdijk — 2013-05-19T02:12:48Z
queued a pull request #1295 with a fix
Comment #2 by fw..vdijk — 2013-05-20T00:53:41Z
PR was merged into master as 14a4b92