aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Naidenov <vanyarock01@gmail.com>2019-07-18 02:32:32 +0300
committerHisham Muhammad <hisham@gobolinux.org>2019-07-17 20:32:32 -0300
commit15494d4ebc734f3585218682ba4eed40f7cb20ef (patch)
treec8f034addc78e43297f1fad444c9601154b8ec3e
parent56a90dbb0bdc7db59857301427825e5a7fc2900f (diff)
downloadluarocks-15494d4ebc734f3585218682ba4eed40f7cb20ef.tar.gz
luarocks-15494d4ebc734f3585218682ba4eed40f7cb20ef.tar.bz2
luarocks-15494d4ebc734f3585218682ba4eed40f7cb20ef.zip
Fix zero values in ziptime (#1056)
If the rock was packed with luarocks then the time in it is set to zeros and this is not the case with the unix format can be removed when date given is added to zipwriter_open_new_file_in_zip
-rw-r--r--src/luarocks/tools/zip.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/tools/zip.lua b/src/luarocks/tools/zip.lua
index 5974c7bf..f08162c5 100644
--- a/src/luarocks/tools/zip.lua
+++ b/src/luarocks/tools/zip.lua
@@ -306,7 +306,7 @@ end
306 306
307 307
308local function ziptime_to_luatime(ztime, zdate) 308local function ziptime_to_luatime(ztime, zdate)
309 return { 309 local date = {
310 year = shr(zdate, 9) + 1980, 310 year = shr(zdate, 9) + 1980,
311 month = shr(lowbits(zdate, 9), 5), 311 month = shr(lowbits(zdate, 9), 5),
312 day = lowbits(zdate, 5), 312 day = lowbits(zdate, 5),
@@ -314,6 +314,11 @@ local function ziptime_to_luatime(ztime, zdate)
314 min = shr(lowbits(ztime, 11), 5), 314 min = shr(lowbits(ztime, 11), 5),
315 sec = lowbits(ztime, 5) * 2, 315 sec = lowbits(ztime, 5) * 2,
316 } 316 }
317
318 if date.month == 0 then date.month = 1 end
319 if date.day == 0 then date.day = 1 end
320
321 return date
317end 322end
318 323
319local function read_file_in_zip(zh, cdr) 324local function read_file_in_zip(zh, cdr)