From dcfabff0fef78ecc0518748d4c25235ea1e63936 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 28 Sep 2024 12:52:33 +0100 Subject: [PATCH] screencopy: cleanup sanitization --- src/shared/ScreencopyShared.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shared/ScreencopyShared.cpp b/src/shared/ScreencopyShared.cpp index 23a7bd4..0810fe7 100644 --- a/src/shared/ScreencopyShared.cpp +++ b/src/shared/ScreencopyShared.cpp @@ -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; }