From 77714e6d30afa3fedabf168f3ed5299decc6f44d Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 30 Sep 2019 01:34:41 +1000 Subject: Remove excess space at end of mirror base URLs from mirror_list.txt. --- mirror-checker.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mirror-checker.lua b/mirror-checker.lua index 8634e3a..c704bf5 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -486,6 +486,10 @@ if 0 < #arg then W("slash at end of path! " .. arg[1]) arg[1] = arg[1]:sub(1, -2) end + if " " == arg[1]:sub(-1, -1) then + W("space at end of path! " .. arg[1]) + arg[1] = arg[1]:sub(1, -2) + end local pu = url.parse("http://" .. arg[1]) if nil ~= arg[2] then logFile, e = io.open("results/mirror-checker-lua_" .. pu.host .. "_" .. arg[2] .. ".log", "a+") @@ -528,6 +532,10 @@ else W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL) m.BaseURL = m.BaseURL:sub(1, -2) end + if " " == m.BaseURL:sub(-1, -1) then + W("space at end of BaseURL in mirror_list.txt! " .. m.BaseURL) + m.BaseURL = m.BaseURL:sub(1, -2) + end local pu = url.parse("http://" .. m.BaseURL) checkHost(m.BaseURL) checkExes("mirror-checker.lua " .. sendArgs) -- cgit v1.1