Merge topic 'encoding-bugs'
9571214e Encoding: Replace some system calls with kwsys calls which handle unicode.
This commit is contained in:
commit
94fbf33ad1
@ -3172,15 +3172,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stat st;
|
unsigned long file_size = cmsys::SystemTools::FileLength(filename.c_str());
|
||||||
if(::stat(filename.c_str(), &st))
|
|
||||||
{
|
|
||||||
std::string errStr = "UPLOAD cannot stat file '";
|
|
||||||
errStr += filename + "'.";
|
|
||||||
this->SetError(errStr);
|
|
||||||
fclose(fin);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
::CURL *curl;
|
::CURL *curl;
|
||||||
::curl_global_init(CURL_GLOBAL_DEFAULT);
|
::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)
|
// and give the size of the upload (optional)
|
||||||
res = ::curl_easy_setopt(curl,
|
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: ");
|
check_curl_result(res, "UPLOAD cannot set input file size: ");
|
||||||
|
|
||||||
res = ::curl_easy_perform(curl);
|
res = ::curl_easy_perform(curl);
|
||||||
|
@ -33,15 +33,13 @@ std::string cmTimestamp::CurrentTime(
|
|||||||
std::string cmTimestamp::FileModificationTime(const char* path,
|
std::string cmTimestamp::FileModificationTime(const char* path,
|
||||||
const std::string& formatString, bool utcFlag)
|
const std::string& formatString, bool utcFlag)
|
||||||
{
|
{
|
||||||
struct stat info;
|
if(!cmsys::SystemTools::FileExists(path))
|
||||||
memset(&info, 0, sizeof(info));
|
|
||||||
|
|
||||||
if(stat(path, &info) != 0)
|
|
||||||
{
|
{
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
return CreateTimestampFromTimeT(info.st_mtime, formatString, utcFlag);
|
time_t mtime = cmsys::SystemTools::ModifiedTime(path);
|
||||||
|
return CreateTimestampFromTimeT(mtime, formatString, utcFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user