handle \n or \r\n line terminators