From 4e9deef331d9d533fe2239739343e00005f95282 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 11 Apr 2022 17:07:09 -0300 Subject: fixes suggested by luacheck --- src/luarocks/core/vers.lua | 2 +- src/luarocks/tools/patch.lua | 2 +- src/luarocks/tools/tar.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/luarocks/core/vers.lua b/src/luarocks/core/vers.lua index e7251bb5..8e617984 100644 --- a/src/luarocks/core/vers.lua +++ b/src/luarocks/core/vers.lua @@ -60,7 +60,7 @@ local version_mt = { -- @param v2 table: version table to compare. -- @return boolean: true if v1 is considered lower than or equal to v2. __le = function(v1, v2) - return not (v2 < v1) + return not (v2 < v1) -- luacheck: ignore end, --- Return version as a string. -- @param v The version table. diff --git a/src/luarocks/tools/patch.lua b/src/luarocks/tools/patch.lua index b12f38fc..cc5293d3 100644 --- a/src/luarocks/tools/patch.lua +++ b/src/luarocks/tools/patch.lua @@ -540,7 +540,7 @@ local function write_new_file(filename, hunk) local fh = io.open(filename, "wb") if not fh then return false end for _, hline in ipairs(hunk.text) do - if not hline:sub(1,1) == "+" then + if hline:sub(1,1) ~= "+" then return false, "malformed patch" end fh:write(hline:sub(2)) diff --git a/src/luarocks/tools/tar.lua b/src/luarocks/tools/tar.lua index aea2809c..21d5920b 100644 --- a/src/luarocks/tools/tar.lua +++ b/src/luarocks/tools/tar.lua @@ -81,7 +81,7 @@ local function read_header_block(block) -- if header.version ~= "00" and header.version ~= " \0" then -- return false, "Unknown version "..header.version -- end - if not checksum_header(block) == header.chksum then + if checksum_header(block) ~= header.chksum then return false, "Failed header checksum" end return header -- cgit v1.2.3-55-g6feb