mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Android: Improve OpenModeToAndroid's handling of 'b'
Now it also works when b isn't at the very end. (+ goes after b.)
This commit is contained in:
parent
4541abd1c0
commit
b28e5149a7
@ -3,6 +3,7 @@
|
||||
|
||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ios>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@ -67,8 +68,7 @@ bool IsPathAndroidContent(const std::string& uri)
|
||||
std::string OpenModeToAndroid(std::string mode)
|
||||
{
|
||||
// The 'b' specifier is not supported by Android. Since we're on POSIX, it's fine to just skip it.
|
||||
if (!mode.empty() && mode.back() == 'b')
|
||||
mode.pop_back();
|
||||
mode.erase(std::remove(mode.begin(), mode.end(), 'b'));
|
||||
|
||||
if (mode == "r+")
|
||||
mode = "rw";
|
||||
|
Loading…
x
Reference in New Issue
Block a user