From 1a7ee589824542659d3f215810b2e6369d283f99 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 25 Jul 2020 17:53:53 -0230 Subject: [PATCH] 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. --- src/emucore/FSNode.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emucore/FSNode.cxx b/src/emucore/FSNode.cxx index a24ab8850..f2e5e477a 100644 --- a/src/emucore/FSNode.cxx +++ b/src/emucore/FSNode.cxx @@ -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();