1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-12-23 17:38:07 +11:00

Merge pull request #1 from JakobCh/master

Make selfextract actually print out the "bad magic" error, p9k loader.
This commit is contained in:
Adorable-Catgirl 2020-03-23 15:52:02 -04:00 committed by GitHub
commit 760bec1eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -0,0 +1,12 @@
local cfgadd = ...
local comp = require("component")
for fs in comp.list("filesystem") do
if comp.invoke(fs, "getLabel") == "Plan9k" and comp.invoke(fs, "exists", "init.lua") then
print("Plan9k discovered on "..fs)
cfgadd(string.format([[
menu.add("Plan9k on %s", function()
return loadmod("loader_openos")("%s")
end)
]], fs:sub(1, 3), fs))
end
end

View File

@ -124,7 +124,7 @@ end
local lname = "" local lname = ""
while lname ~= "TRAILER!!!" do while lname ~= "TRAILER!!!" do
local dat = read(22) local dat = read(22)
local e = read_header(dat) local e = assert(read_header(dat))
e.name = read(e.namesize) e.name = read(e.namesize)
e.pos = seek(e.namesize & 1) e.pos = seek(e.namesize & 1)
seek(e.filesize + (e.filesize & 1)) seek(e.filesize + (e.filesize & 1))