summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-05 21:31:09 -0700
committerGitHub <noreply@github.com>2017-06-05 21:31:09 -0700
commit442e614021462e6464628c74d6fafceaf7627fa1 (patch)
treecfe6ab994601dca77990586e5fc707f12a00d73d /Source/Core/Common/StringUtil.cpp
parentc8166951a0bfce3a0dab457e62b40b8649dd3c3c (diff)
parentf28f23af1d613670c1ed5fc28e826544f5494333 (diff)
Merge pull request #5536 from sepalani/getstring
HLE: Prevent GetStringVA to strip newlines
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
-rw-r--r--Source/Core/Common/StringUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp
index 80c74ac8a7..6548205fb0 100644
--- a/Source/Core/Common/StringUtil.cpp
+++ b/Source/Core/Common/StringUtil.cpp
@@ -405,6 +405,12 @@ bool StringEndsWith(const std::string& str, const std::string& end)
return str.size() >= end.size() && std::equal(end.rbegin(), end.rend(), str.rbegin());
}
+void StringPopBackIf(std::string* s, char c)
+{
+ if (!s->empty() && s->back() == c)
+ s->pop_back();
+}
+
#ifdef _WIN32
std::string UTF16ToUTF8(const std::wstring& input)