string escape

master
Juraj Vajda 2018-11-13 19:29:24 -05:00
parent 0b49973d11
commit 6b2ebc3766
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ local function esc(x)
:gsub('%.', '%%.')
:gsub('%,', '%%,')
:gsub('%;', '%%;')
:gsub('%\\', '%%\\')
:gsub('%[', '%%[')
:gsub('%]', '%%]')
:gsub('%*', '%%*')
@ -52,6 +53,7 @@ end
function x_marketplace.store_find(string)
local found = ""
local str = esc(string)
for k, v in pairs(x_marketplace.store_list) do
if string.find(k, str) then
found = found..k.." buy: "..string.format("%.2f", v.buy).." sell: "..string.format("%.2f", v.sell).."\n"