using less memory than GNU getline and __properly__ treading CRLF as if it was LF