From f803347fc8a40aa3ba18c768dba7ee4efb6ff9ea Mon Sep 17 00:00:00 2001 From: actionless Date: Wed, 22 Apr 2020 01:52:41 +0200 Subject: [PATCH] fixup! fix(gears: matcher: default_matcher): handle sidecase of string.match-ing the empty string ('') style: return true/false instead of assigning nil to result --- lib/gears/matcher.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gears/matcher.lua b/lib/gears/matcher.lua index 636eb7aa..c7a66ca2 100644 --- a/lib/gears/matcher.lua +++ b/lib/gears/matcher.lua @@ -80,10 +80,10 @@ local matcher = {} local function default_matcher(a, b) local result = a == b - if result then return result end + if result then return true end if type(a) == "string" and type(b) == "string" then result = a:match(b) - if result == '' then result = nil end + if result == '' then return false end end return result end