[coding] Fixed copying an empty file.

This commit is contained in:
Maksim Andrianov 2019-08-07 15:27:14 +03:00 committed by mpimenov
parent df1dba7695
commit 05d01f8072

View file

@ -300,6 +300,9 @@ bool CopyFileX(string const & fOld, string const & fNew)
if (ifs.is_open() && ofs.is_open())
{
if (ifs.peek() == ifstream::traits_type::eof())
return true;
ofs << ifs.rdbuf();
ofs.flush();