1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-22 03:54:20 -05:00

detect absolute/relative paths in pkgfs

This commit is contained in:
XeonSquared 2020-06-05 22:45:31 +10:00
parent ffc6c8915a
commit 21d71b29ba

View File

@ -99,7 +99,9 @@ function pkgfs.component.close(handle)
end end
function pkgfs.add(fname,comp) function pkgfs.add(fname,comp)
local fname = "/"..fnormalize(os.getenv("PWD").."/"..fname) if fname:sub(1,1) ~= "/" then
fname = "/"..fnormalize(os.getenv("PWD").."/"..fname)
end
local f = fopen(fname,comp) local f = fopen(fname,comp)
if not fname then error("unable to open file") end if not fname then error("unable to open file") end
print(fname) print(fname)