From c0e9d50624cd1934aaa23bc61b17990306bcaed9 Mon Sep 17 00:00:00 2001 From: Ludovicus Date: Tue, 25 Jun 2019 18:01:38 -0400 Subject: [PATCH] Make comparison only using lowercase letters and no spaces (UTF-8 safety) --- TomTom.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index e3c6fbb..e0a79e8 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -1267,8 +1267,8 @@ end local wrongseparator = "(%d)" .. (tonumber("1.1") and "," or ".") .. "(%d)" local rightseparator = "%1" .. (tonumber("1.1") and "." or ",") .. "%2" --- Make comparison only lowercase letters and numbers -local function lowergsub(s) return s:lower():gsub("[^%a%d]", "") end +-- Make comparison only using lowercase letters and no spaces +local function lowergsub(s) return s:lower():gsub("[%s]", "") end SlashCmdList["TOMTOM_WAY"] = function(msg) msg = msg:gsub("(%d)[%.,] (%d)", "%1 %2"):gsub(wrongseparator, rightseparator) -- 1.7.9.5