summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a7df5bf..5c36e69 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -484,6 +484,18 @@ const char *cmSystemTools::ConvertToWindowsSlashesAndCleanUp(std::string& path)
return path.c_str();
}
+inline void CleanText(char* s)
+{
+ while(*s != 0)
+ {
+ if(*s == '\r')
+ {
+ *s = ' ';
+ }
+ s++;
+ }
+}
+
bool cmSystemTools::ParseFunction(std::ifstream& fin,
std::string& name,
std::vector<std::string>& arguments,
@@ -497,9 +509,9 @@ bool cmSystemTools::ParseFunction(std::ifstream& fin,
{
return false;
}
-
if(fin.getline(inbuffer, BUFFER_SIZE ) )
{
+ CleanText(&inbuffer[0]);
cmRegularExpression blankLine("^[ \t]*$");
cmRegularExpression comment("^[ \t]*#.*$");
cmRegularExpression oneLiner("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)\\)[ \t]*$");
@@ -534,6 +546,7 @@ bool cmSystemTools::ParseFunction(std::ifstream& fin,
// read lines until the end paren is found
if(fin.getline(inbuffer, BUFFER_SIZE ) )
{
+ CleanText(&inbuffer[0]);
// Check for comment lines and ignore them.
if(blankLine.find(inbuffer) || comment.find(inbuffer))
{ continue; }