summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index ad2e52965..13170092e 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -499,3 +499,15 @@ std::string stringToHexPath(const std::string &str)
hex += strprintf("%%%2x", (int)str[f]);
return hex;
}
+
+void deleteCharLeft(std::string &str, unsigned *pos)
+{
+ while (*pos > 0)
+ {
+ (*pos)--;
+ int v = str[*pos];
+ str.erase(*pos, 1);
+ if ((v & 192) != 128)
+ break;
+ }
+}