net.dns: Import unpack() in forward-compatible way (Fixes compat with Lua5.2+)
authorKim Alvefur <zash@zash.se>
Mon, 28 Mar 2016 17:56:12 +0000 (19:56 +0200)
committerKim Alvefur <zash@zash.se>
Mon, 28 Mar 2016 17:56:12 +0000 (19:56 +0200)
net/dns.lua

index b047ec542ec3813328d8ee2aaaaa153ba98316df..689020a47a792e986fc95ad01546c654eca25a1e 100644 (file)
@@ -22,8 +22,8 @@ local is_windows = (_ and windows) or os.getenv("WINDIR");
 local coroutine, io, math, string, table =
       coroutine, io, math, string, table;
 
-local ipairs, next, pairs, print, setmetatable, tostring, assert, error, unpack, select, type=
-      ipairs, next, pairs, print, setmetatable, tostring, assert, error, unpack, select, type;
+local ipairs, next, pairs, print, setmetatable, tostring, assert, error, select, type, unpack=
+      ipairs, next, pairs, print, setmetatable, tostring, assert, error, select, type, table.unpack or unpack;
 
 local ztact = { -- public domain 20080404 lua@ztact.com
        get = function(parent, ...)