zero length lines and adding a blank line and adding an exra cr/lf for lines near max length (LP: #1717576)