Here's an alternative solution which maintains support for \r\r\n by peeking two bytes into the future. /Tomas