Diff

net/dns.lua @ 7322:addf60d25356

net.dns: Import unpack() in forward-compatible way (Fixes compat with Lua5.2+)
author Kim Alvefur <zash@zash.se>
date Mon, 28 Mar 2016 19:56:12 +0200
parent 7098:5286e79c6829
child 7469:363e4a5e9b0a
line wrap: on
line diff
--- a/net/dns.lua	Mon Mar 28 13:27:42 2016 +0200
+++ b/net/dns.lua	Mon Mar 28 19:56:12 2016 +0200
@@ -22,8 +22,8 @@
 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, ...)