aboutsummaryrefslogtreecommitdiff
path: root/src/fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs.cpp')
-rw-r--r--src/fs.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index 3c8f4c0247..f937f64e04 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -160,6 +160,7 @@ static std::string openmodeToStr(std::ios_base::openmode mode)
void ifstream::open(const fs::path& p, std::ios_base::openmode mode)
{
close();
+ mode |= std::ios_base::in;
m_file = fsbridge::fopen(p, openmodeToStr(mode).c_str());
if (m_file == nullptr) {
return;
@@ -183,6 +184,7 @@ void ifstream::close()
void ofstream::open(const fs::path& p, std::ios_base::openmode mode)
{
close();
+ mode |= std::ios_base::out;
m_file = fsbridge::fopen(p, openmodeToStr(mode).c_str());
if (m_file == nullptr) {
return;