Fix bug with accessing files as text using binary I/O.

This doesn't seem to matter for Linux and macOS, but breaks Windows CRLF
endings.
This commit is contained in:
Stephen Anthony 2020-07-25 17:53:53 -02:30
parent ab942bc221
commit 60bf9a5754
1 changed files with 2 additions and 2 deletions

View File

@ -302,7 +302,7 @@ size_t FilesystemNode::read(stringstream& buffer) const
// Otherwise, the default behaviour is to read from a normal C++ ifstream
// and convert to a stringstream
std::ifstream in(getPath(), std::ios::binary);
std::ifstream in(getPath());
if (in)
{
in.seekg(0, std::ios::end);
@ -355,7 +355,7 @@ size_t FilesystemNode::write(const stringstream& buffer) const
return sizeWritten;
// Otherwise, the default behaviour is to write to a normal C++ ofstream
std::ofstream out(getPath(), std::ios::binary);
std::ofstream out(getPath());
if (out)
{
out << buffer.rdbuf();