ugly line-ending conversion, convert crlf --> lf