D-Programming-Language/phobos — pull request #375 by andralex (2011-12-18 20:43:39+00:00)
Title: Fix bug in byLine() with empty files

byLine() had a bug (assertion failed) with empty files. This is because opening an empty file does not set the end-of-file indicator. The proposed solution issues a pair of getc/ungetc calls only once just before the very first read. This is unlikely to affect performance. If there are better solutions, please chime in.