Skip to content

Commit

Permalink
screencopy: cleanup sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Sep 28, 2024
1 parent 4adb6c4 commit dcfabff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/shared/ScreencopyShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dcfabff

Please sign in to comment.