summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-07-01 12:37:21 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2014-07-01 12:38:35 (GMT)
commit9571214e55cb8b86dadb26b6b1d696ef488bdd4b (patch)
tree716a9d5a996a68e6fe6c1275f3b0d0b76babf9ec /Source/cmFileCommand.cxx
parent949715f027f738cb3558b69f5288f7655945ea80 (diff)
downloadCMake-9571214e55cb8b86dadb26b6b1d696ef488bdd4b.zip
CMake-9571214e55cb8b86dadb26b6b1d696ef488bdd4b.tar.gz
CMake-9571214e55cb8b86dadb26b6b1d696ef488bdd4b.tar.bz2
Encoding: Replace some system calls with kwsys calls which handle unicode.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 61c6eb3..e47365a 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3172,15 +3172,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
return false;
}
- struct stat st;
- if(::stat(filename.c_str(), &st))
- {
- std::string errStr = "UPLOAD cannot stat file '";
- errStr += filename + "'.";
- this->SetError(errStr);
- fclose(fin);
- return false;
- }
+ unsigned long file_size = cmsys::SystemTools::FileLength(filename.c_str());
::CURL *curl;
::curl_global_init(CURL_GLOBAL_DEFAULT);
@@ -3270,7 +3262,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
// and give the size of the upload (optional)
res = ::curl_easy_setopt(curl,
- CURLOPT_INFILESIZE, static_cast<long>(st.st_size));
+ CURLOPT_INFILESIZE, static_cast<long>(file_size));
check_curl_result(res, "UPLOAD cannot set input file size: ");
res = ::curl_easy_perform(curl);