mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
Only initially open files as writable if they actually should be.
This commit is contained in:
@ -85,7 +85,9 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
f.open(QIODevice::ReadWrite);
|
||||
QIODevice::OpenMode qmode = mode[0] == 'w' ? QIODevice::ReadWrite : QIODevice::ReadOnly;
|
||||
|
||||
f.open(qmode);
|
||||
FILE* file = fdopen(dup(f.handle()), mode);
|
||||
f.close();
|
||||
|
||||
|
Reference in New Issue
Block a user