mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 06:35:57 +01:00
screencopy: cleanup sanitization
This commit is contained in:
parent
4adb6c4c41
commit
dcfabff0fe
1 changed files with 2 additions and 4 deletions
|
@ -11,13 +11,11 @@
|
|||
|
||||
std::string sanitizeNameForWindowList(const std::string& name) {
|
||||
std::string result = name;
|
||||
if (result[0] == '\"')
|
||||
result[0] = ' ';
|
||||
std::replace(result.begin(), result.end(), '\'', ' ');
|
||||
std::replace(result.begin(), result.end(), '\"', ' ');
|
||||
for (size_t i = 1; i < result.size(); ++i) {
|
||||
if (result[i - 1] == '>' && result[i] == ']')
|
||||
result[i] = ' ';
|
||||
if (result[i] == '\"' || result[i] == '\'')
|
||||
result[i] = ' ';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue