summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2014-12-08 23:45:17 +0100
committerSubv <subv2112@gmail.com>2014-12-08 23:45:17 +0100
commit1d1078fd8b49bd501e11676d0bdb73d3bb515efc (patch)
treeaa5d2706d62be597bdb5160c3e946cbe96482675 /src
parentMerge pull request #245 from rohit-n/null-nullptr (diff)
downloadyuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar.gz
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar.bz2
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar.lz
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar.xz
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.tar.zst
yuzu-1d1078fd8b49bd501e11676d0bdb73d3bb515efc.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/file_sdmc.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/file_sdmc.cpp b/src/core/file_sys/file_sdmc.cpp
index a4b90670a..b01d96e3d 100644
--- a/src/core/file_sys/file_sdmc.cpp
+++ b/src/core/file_sys/file_sdmc.cpp
@@ -38,12 +38,15 @@ bool File_SDMC::Open() {
}
std::string mode_string;
- if (mode.read_flag && mode.write_flag)
+ if (mode.create_flag)
mode_string = "w+";
+ else if (mode.write_flag)
+ mode_string = "r+"; // Files opened with Write access can be read from
else if (mode.read_flag)
mode_string = "r";
- else if (mode.write_flag)
- mode_string = "w";
+
+ // Open the file in binary mode, to avoid problems with CR/LF on Windows systems
+ mode_string += "b";
file = new FileUtil::IOFile(path, mode_string.c_str());
return true;