Fix a bug if a newline contains a \r.