diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-02-18 19:36:04 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-02-18 19:36:04 (GMT) |
commit | 60b9a2c14bf1883ba18c4cf650675382554c2627 (patch) | |
tree | 2d994856402dfe0f454eb363b3855b9b3d3046ec /Source/cmSystemTools.cxx | |
parent | 12c5f0fa26ab3b90d13cd872ca7f0ea582e1cebc (diff) | |
download | CMake-60b9a2c14bf1883ba18c4cf650675382554c2627.zip CMake-60b9a2c14bf1883ba18c4cf650675382554c2627.tar.gz CMake-60b9a2c14bf1883ba18c4cf650675382554c2627.tar.bz2 |
ENH: first pass at dot net support
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 6f7a071..fa639e3 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -784,15 +784,58 @@ bool cmSystemTools::FilesDiffer(const char* source, { return true; } - + const int buffer_length = 4096; + char bufferSource[buffer_length]; + char bufferDest[buffer_length]; while(finSource && finDestination) { - char s, d; - finSource >> s; - finDestination >> d; - if(s != d) + if(finSource.getline(bufferSource, buffer_length, '\n') + || finSource.gcount()) { - return true; + if(finDestination.getline(bufferDest, buffer_length, '\n') + || finDestination.gcount()) + { + // both if statements passed + if(finSource.eof()) + { + if(!finDestination.eof()) + { + return true; + } + if(finSource.gcount() != finDestination.gcount()) + { + return true; + } + if(strncmp(bufferSource, bufferDest, finSource.gcount()) != 0) + { + return true; + } + } + else if(finSource.fail()) + { + if(!finDestination.fail()) + { + return true; + } + if(strcmp(bufferSource, bufferDest) != 0) + { + return true; + } + finSource.clear(finSource.rdstate() & ~std::ios::failbit); + finDestination.clear(finDestination.rdstate() & ~std::ios::failbit); + } + else + { + if(strcmp(bufferSource, bufferDest) != 0) + { + return true; + } + } + } + else + { + return true; + } } } return false; |