From fc828882d7354e70ff2e51dd6dcf4ba4ee50349d Mon Sep 17 00:00:00 2001 From: "Y. Wang" Date: Mon, 18 Mar 2024 02:02:27 +0100 Subject: Fix inconsistent backslash escaping --- advtrains/poconvert.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains/poconvert.lua') diff --git a/advtrains/poconvert.lua b/advtrains/poconvert.lua index f44cbd1..3075282 100644 --- a/advtrains/poconvert.lua +++ b/advtrains/poconvert.lua @@ -13,12 +13,12 @@ do local function replace_single(pfx, c) local pl = #pfx if pl % 2 == 0 then - return pfx .. c + return pfx:sub(1, pl/2) .. c end return string.sub(pfx, 1, math.floor(pl/2)) .. (schartbl[c] or c) end unescape_string = function(str) - return (string.gsub(str, [[(\+)([abefnrtv'"?])]], replace_single):gsub([[\\]], [[\]])) + return string.gsub(str, [[(\+)([abefnrtv'"?])]], replace_single) end end -- cgit v1.2.3