From a3e0ec64ae3fcf816faf21e6e25379c6b8993b01 Mon Sep 17 00:00:00 2001 From: mcplayer3 <219271061+mcplayer3@users.noreply.github.com> Date: Fri, 19 Jun 2026 15:03:45 +1000 Subject: [PATCH] cat now inserts a newline at the end of the file if there isn't one already --- halyde/apps/cat.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/halyde/apps/cat.lua b/halyde/apps/cat.lua index a5ea2f4..df69585 100644 --- a/halyde/apps/cat.lua +++ b/halyde/apps/cat.lua @@ -15,11 +15,16 @@ for _, file in pairs(args) do terminal.write("\27[91mCan't open " .. file .. "\27[0m\n") goto continue end + local enddata while true do local data = handle:read(math.huge or math.maxinteger) if data == nil then break end terminal.write(data) + enddata = data end handle:close() + if string.sub(enddata, -1, -1) ~= "\n" then + print("") + end ::continue:: end