summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-26 18:37:31 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-26 18:37:31 (GMT)
commit7a31bc85211529f6c0b49d3fda9d38edcac6a83b (patch)
tree7a157c18979bb3db394112af63a5bc36b2349963 /Source/cmMakefile.cxx
parent9b89d84210527292f411590187eb6d7aa1e4eb20 (diff)
downloadCMake-7a31bc85211529f6c0b49d3fda9d38edcac6a83b.zip
CMake-7a31bc85211529f6c0b49d3fda9d38edcac6a83b.tar.gz
CMake-7a31bc85211529f6c0b49d3fda9d38edcac6a83b.tar.bz2
BUG: ConfigureFile must read/write in binary mode to avoid windows newline trouble. The problem occurred when configuring a file in cygwin from a path starting with a windows drive letter instead of a posix path.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1e1b15f..e4ef96d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2617,7 +2617,11 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
{
std::string tempOutputFile = soutfile;
tempOutputFile += ".tmp";
- std::ofstream fout(tempOutputFile.c_str());
+ std::ofstream fout(tempOutputFile.c_str()
+#if defined(_WIN32) || defined(__CYGWIN__)
+ , std::ios::out | std::ios::binary
+#endif
+ );
if(!fout)
{
cmSystemTools::Error(
@@ -2626,7 +2630,11 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
cmSystemTools::ReportLastSystemError("");
return 0;
}
- std::ifstream fin(sinfile.c_str());
+ std::ifstream fin(sinfile.c_str()
+#if defined(_WIN32) || defined(__CYGWIN__)
+ , std::ios::in | std::ios::binary
+#endif
+ );
if(!fin)
{
cmSystemTools::Error("Could not open file for read in copy operation ",