diff options
author | Michael Savage <github@mikejsavage.co.uk> | 2023-12-12 00:29:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 19:29:39 -0300 |
commit | aff9d641c60881d9fbb2e86bb5426a38fa4f1a59 (patch) | |
tree | 41373a5e502c48e2b2bd4d946de82d9e133261c1 | |
parent | 4cfcf9d8df1abd7cca9f2c3590402ada543df327 (diff) | |
download | luarocks-aff9d641c60881d9fbb2e86bb5426a38fa4f1a59.tar.gz luarocks-aff9d641c60881d9fbb2e86bb5426a38fa4f1a59.tar.bz2 luarocks-aff9d641c60881d9fbb2e86bb5426a38fa4f1a59.zip |
Don't use floats to parse the Lua version (#1552)
-rw-r--r-- | src/luarocks/deps.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 2b8795ad..6f8990d7 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -652,10 +652,8 @@ function deps.scan_deps(results, manifest, name, version, deps_mode) | |||
652 | end | 652 | end |
653 | 653 | ||
654 | local function lua_h_exists(d, luaver) | 654 | local function lua_h_exists(d, luaver) |
655 | local n = tonumber(luaver) | 655 | local major, minor = luaver:match("(%d+)%.(%d+)") |
656 | local major = math.floor(n) | 656 | local luanum = ("%s%02d"):format(major, tonumber(minor)) |
657 | local minor = (n - major) * 10 | ||
658 | local luanum = math.floor(major * 100 + minor) | ||
659 | 657 | ||
660 | local lua_h = dir.path(d, "lua.h") | 658 | local lua_h = dir.path(d, "lua.h") |
661 | local fd = io.open(lua_h) | 659 | local fd = io.open(lua_h) |