readline returns nil on EOF