truncate unneeded space at end of lines