screencopy: cleanup sanitization

This commit is contained in:
Vaxry 2024-09-28 12:52:33 +01:00
parent 4adb6c4c41
commit dcfabff0fe

View file

@ -11,13 +11,11 @@
std::string sanitizeNameForWindowList(const std::string& name) { std::string sanitizeNameForWindowList(const std::string& name) {
std::string result = name; std::string result = name;
if (result[0] == '\"') std::replace(result.begin(), result.end(), '\'', ' ');
result[0] = ' '; std::replace(result.begin(), result.end(), '\"', ' ');
for (size_t i = 1; i < result.size(); ++i) { for (size_t i = 1; i < result.size(); ++i) {
if (result[i - 1] == '>' && result[i] == ']') if (result[i - 1] == '>' && result[i] == ']')
result[i] = ' '; result[i] = ' ';
if (result[i] == '\"' || result[i] == '\'')
result[i] = ' ';
} }
return result; return result;
} }