BUG: On Windows, remove extra CR characters. Hopefully this will result in not duplicated new-lines

This commit is contained in:
Andy Cedilnik 2004-10-11 13:57:33 -04:00
parent d4f1785473
commit 9594c888ab
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,11 @@ std::string cmCTest::MakeXMLSafe(const std::string& str)
for (std::string::size_type pos = 0; pos < str.size(); pos ++ ) for (std::string::size_type pos = 0; pos < str.size(); pos ++ )
{ {
unsigned char ch = str[pos]; unsigned char ch = str[pos];
if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 ) if ( ch == '\r' )
{
// Ignore extra CR characters.
}
else if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 )
{ {
char buffer[33]; char buffer[33];
sprintf(buffer, "&lt;%d&gt;", (int)ch); sprintf(buffer, "&lt;%d&gt;", (int)ch);