Fix a bug that is newline counting goes wrong with files end without newline
 Correctly print the length of arbitrary long input lines, and as much as possible of the text.