summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-10-03 22:23:41 +0000
committerKarl Berry <karl@freefriends.org>2013-10-03 22:23:41 +0000
commit17c26f8a0e90231c7f95311cd8270fcd345002e4 (patch)
treeb0378783b5421fc11bc25ca967c349d4938fd923 /Master/texmf-dist/tex/generic/pgfplots/lua
parent9334469d545fb017cccf5b7f4075005dc17a4949 (diff)
pgfplots (3oct13)
git-svn-id: svn://tug.org/texlive/trunk@31822 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots.lua b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots.lua
index 8242222e8d6..dcb8ea94007 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots.lua
+++ b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots.lua
@@ -1,6 +1,13 @@
pgfplotsGetLuaBinaryStringFromCharIndicesChunkSize = 7000;
+if unpack == nil then
+ -- LUA 0.76 renamed unpack to table.unpack
+ pgfplotsUnpack = table.unpack;
+else
+ pgfplotsUnpack = unpack;
+end
+
-- Takes a table containing an arbitrary number of integers in the range 0..255 and converts it
-- into a binary stream of the corresponding binary chars.
--
@@ -21,10 +28,10 @@ function pgfplotsGetLuaBinaryStringFromCharIndices(charIndices)
-- ok, append all full chunks of chunkSize first:
local numFullChunks = math.floor(len/chunkSize);
for i = 0, numFullChunks-1, 1 do
- table.insert(buf, string.char(unpack(charIndices, 1+i*chunkSize, (i+1)*chunkSize)));
+ table.insert(buf, string.char(pgfplotsUnpack(charIndices, 1+i*chunkSize, (i+1)*chunkSize)));
end
-- append the rest:
- table.insert(buf, string.char(unpack(charIndices, 1+numFullChunks*chunkSize)));
+ table.insert(buf, string.char(pgfplotsUnpack(charIndices, 1+numFullChunks*chunkSize)));
return table.concat(buf);
end