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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index d914efe30..835f9ce00 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -387,3 +387,13 @@ std::list<int> splitToIntList(const std::string &text, char separator)
return tokens;
}
+
+std::string combineDye(std::string file, std::string dye)
+{
+ if (dye.empty())
+ return file;
+ size_t pos = file.find_last_of("|");
+ if (pos != std::string::npos)
+ return file.substr(0, pos) + "|" + dye;
+ return file + "|" + dye;
+}