summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-12-09 00:05:03 +0100
committerbunnei <bunneidev@gmail.com>2014-12-09 00:05:03 +0100
commit1f4953e1bb1070ab4060737ea9eaf255a53353bf (patch)
tree89f68edb712439c9442a5671c972f8ae544c2466 /src/core
parentMerge pull request #260 from archshift/opendir (diff)
parentKernel/File: Fixed file read/write hwtests (diff)
downloadyuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar.gz
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar.bz2
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar.lz
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar.xz
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.tar.zst
yuzu-1f4953e1bb1070ab4060737ea9eaf255a53353bf.zip
Diffstat (limited to 'src/core')
-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;