comm: handle final lines without \n