summaryrefslogtreecommitdiff
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorGravatar BreadFish642019-12-24 14:19:18 -0600
committerGravatar FearlessTobi2020-01-23 23:08:05 +0100
commita31ed02ae48eaeb3ee6ac1c45f21d5dd3a9ac376 (patch)
tree124b9f967df80d15379059dccd256903463bfa29 /src/common/string_util.cpp
parentMerge pull request #3341 from bunnei/time-posix-myrule (diff)
downloadyuzu-a31ed02ae48eaeb3ee6ac1c45f21d5dd3a9ac376.tar.gz
yuzu-a31ed02ae48eaeb3ee6ac1c45f21d5dd3a9ac376.tar.xz
yuzu-a31ed02ae48eaeb3ee6ac1c45f21d5dd3a9ac376.zip
common/logging: don't use regex for path trimming
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 959f278aa..84883a1d3 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -223,26 +223,4 @@ std::u16string UTF16StringFromFixedZeroTerminatedBuffer(std::u16string_view buff
223 return std::u16string(buffer.begin(), buffer.begin() + len); 223 return std::u16string(buffer.begin(), buffer.begin() + len);
224} 224}
225 225
226const char* TrimSourcePath(const char* path, const char* root) {
227 const char* p = path;
228
229 while (*p != '\0') {
230 const char* next_slash = p;
231 while (*next_slash != '\0' && *next_slash != '/' && *next_slash != '\\') {
232 ++next_slash;
233 }
234
235 bool is_src = Common::ComparePartialString(p, next_slash, root);
236 p = next_slash;
237
238 if (*p != '\0') {
239 ++p;
240 }
241 if (is_src) {
242 path = p;
243 }
244 }
245 return path;
246}
247
248} // namespace Common 226} // namespace Common