mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 07:10:00 -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;
|
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);
|
FILE* file = fdopen(dup(f.handle()), mode);
|
||||||
f.close();
|
f.close();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user