summaryrefslogtreecommitdiffstats
path: root/common/log.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-28 11:26:00 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-28 11:26:00 +0100
commitfb41cc4b30792238eed235aa5c6a8a3ba47b87a6 (patch)
tree97c9dcf1501065d8953740f5f21251788979b2ab /common/log.cpp
parent3d087ee4d7e9c1e627001631100c5ff403a1757b (diff)
downloadsink-fb41cc4b30792238eed235aa5c6a8a3ba47b87a6.tar.gz
sink-fb41cc4b30792238eed235aa5c6a8a3ba47b87a6.zip
Fixed log pattern matching
Diffstat (limited to 'common/log.cpp')
-rw-r--r--common/log.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/common/log.cpp b/common/log.cpp
index bfc9d5e..e726cd5 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -289,18 +289,16 @@ static void collectDebugArea(const QString &debugArea)
289static bool containsItemStartingWith(const QByteArray &pattern, const QByteArrayList &list) 289static bool containsItemStartingWith(const QByteArray &pattern, const QByteArrayList &list)
290{ 290{
291 for (const auto &item : list) { 291 for (const auto &item : list) {
292 int start = 0;
293 int end = item.size();
292 if (item.startsWith('*')) { 294 if (item.startsWith('*')) {
293 auto stripped = item.mid(1); 295 start++;
294 if (stripped.endsWith('*')) { 296 }
295 stripped.chop(1); 297 if (item.endsWith('*')) {
296 } 298 end--;
297 if (pattern.contains(stripped)) { 299 }
298 return true; 300 if (pattern.contains(item.mid(start, end - start))) {
299 } 301 return true;
300 } else {
301 if (pattern.contains(item)) {
302 return true;
303 }
304 } 302 }
305 } 303 }
306 return false; 304 return false;