Support input files that do not finish with CRLF.

Before processing the line, it checks whether the line finishes with \n or not. If it does not, it concatenates \n for the proper treatment.