diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-07 18:26:16 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-07 18:26:16 (GMT) |
commit | 0bfad2946dc3da390fed5b58dcf493b55886aa31 (patch) | |
tree | 44dd48993271152fb7f0d96e5134173a7b502794 /Source/cmFileCommand.cxx | |
parent | 4f44c7875f6d4769f5f3a246f3bbd07cd1410e22 (diff) | |
download | CMake-0bfad2946dc3da390fed5b58dcf493b55886aa31.zip CMake-0bfad2946dc3da390fed5b58dcf493b55886aa31.tar.gz CMake-0bfad2946dc3da390fed5b58dcf493b55886aa31.tar.bz2 |
ENH: make sure files are binary for download and make status a pair of value string
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3728a5f..a30b704 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1970,7 +1970,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> } i++; } - std::ofstream fout(file.c_str()); + std::ofstream fout(file.c_str(), std::ios::binary); if(!fout) { this->SetError("FILE(DOWNLOAD url file TIMEOUT time) can not open " @@ -2008,8 +2008,10 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> curl_easy_cleanup(curl); if(statusVar.size()) { - this->Makefile->AddDefinition(statusVar.c_str(), - curl_easy_strerror(res)); + cmOStringStream result; + result << (int)res << ";\"" << curl_easy_strerror(res) << "\""; + this->Makefile->AddDefinition(statusVar.c_str(), + result.str().c_str()); } curl_global_cleanup(); if(chunkDebug.size()) |