summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-10-13 20:43:33 +0200
committerGitHub <noreply@github.com>2021-10-13 20:43:33 +0200
commita0a91ec4b86b16624b2da7000a0f54852cd33872 (patch)
tree7b09a19f201575343f2747fc008438d79c43b261 /Source/Android/jni/AndroidCommon/AndroidCommon.cpp
parent71051b70277ccb68c8fc42f20aa3b6b06dbb9974 (diff)
parentb28e5149a75e8f35d0a8b464acbe5e8fbc6ed6dd (diff)
Merge pull request #10163 from JosJuice/b
Android: Improve OpenModeToAndroid's handling of 'b'
Diffstat (limited to 'Source/Android/jni/AndroidCommon/AndroidCommon.cpp')
-rw-r--r--Source/Android/jni/AndroidCommon/AndroidCommon.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Android/jni/AndroidCommon/AndroidCommon.cpp b/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
index 3ae630f7c0..06696b7ec6 100644
--- a/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
+++ b/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
@@ -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";