OpenOS: fix ls -l on Lua 5.4

This commit is contained in:
Adrian Siekierka 2023-06-04 09:28:05 +02:00
parent 9c95f10879
commit 34e1f1f131
3 changed files with 4 additions and 4 deletions

View File

@ -231,7 +231,7 @@ local function formatTime(epochms) -- from /lib/core/full_ls.lua
if opts["full-time"] then
return string.format("%s-%s-%s %s:%s:%s ", d.year, pad(nod(d.month)), pad(day), hour, min, sec)
else
return string.format("%s %+2s %+2s:%+2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
return string.format("%s %2s %2s:%2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
end
end

View File

@ -1,7 +1,7 @@
-- called from /init.lua
local raw_loadfile = ...
_G._OSVERSION = "OpenOS 1.8.1"
_G._OSVERSION = "OpenOS 1.8.2"
-- luacheck: globals component computer unicode _OSVERSION
local component = component

View File

@ -139,7 +139,7 @@ local function formatDate(epochms)
if ops["full-time"] then
return string.format("%s-%s-%s %s:%s:%s ", d.year, pad(nod(d.month)), pad(day), hour, min, sec)
else
return string.format("%s %+2s %+2s:%+2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
return string.format("%s %2s %2s:%2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
end
end
@ -222,7 +222,7 @@ local function display(names)
local write_mode = info.fs.isReadOnly() and '-' or 'w'
local size = formatSize(info.size)
local modDate = formatDate(info.time)
local format = "%s-r%s %+"..tostring(max_size_width).."s %"..tostring(max_date_width).."s"
local format = "%s-r%s %"..tostring(max_size_width).."s %"..tostring(max_date_width).."s"
local meta = string.format(format, file_type, write_mode, size, modDate)
local item = info.name..link_target
return {{name = meta}, {color = colorize(info), name = item}}