diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-10-09 14:25:51 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-10-09 14:25:51 (GMT) |
commit | 6b1ab49ae64b92f5ef35f226d1ae2557a11dddf3 (patch) | |
tree | 0173302a07863b0c2c04be2f6baf754ecf3b4353 /Source/cmSystemTools.cxx | |
parent | d0aec59356d65ede1cd5b89aa5ca3481fc216684 (diff) | |
download | CMake-6b1ab49ae64b92f5ef35f226d1ae2557a11dddf3.zip CMake-6b1ab49ae64b92f5ef35f226d1ae2557a11dddf3.tar.gz CMake-6b1ab49ae64b92f5ef35f226d1ae2557a11dddf3.tar.bz2 |
ENH: better fix for dos return in lines, use the regular expression and don't edit the input line
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5c36e69..44474a5 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -484,18 +484,6 @@ 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, @@ -511,12 +499,11 @@ bool cmSystemTools::ParseFunction(std::ifstream& fin, } if(fin.getline(inbuffer, BUFFER_SIZE ) ) { - CleanText(&inbuffer[0]); - cmRegularExpression blankLine("^[ \t]*$"); + cmRegularExpression blankLine("^[ \t\r]*$"); cmRegularExpression comment("^[ \t]*#.*$"); - cmRegularExpression oneLiner("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)\\)[ \t]*$"); + cmRegularExpression oneLiner("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)\\)[ \t\r]*$"); cmRegularExpression multiLine("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)$"); - cmRegularExpression lastLine("^(.*)\\)[ \t]*$"); + cmRegularExpression lastLine("^(.*)\\)[ \t\r]*$"); // check for black line or comment if(blankLine.find(inbuffer) || comment.find(inbuffer)) @@ -546,7 +533,6 @@ 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; } |