Treat only \n as line terminator, and eat all \r characters.

This fixes a crash where a diff introduced "\r\r\n".